User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,534 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,041 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 2451 | Replies: 7
Reply
Join Date: Oct 2007
Posts: 5
Reputation: Dr.Del is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dr.Del Dr.Del is offline Offline
Newbie Poster

Help with Print Reports VB 6

  #1  
Oct 12th, 2007
Hi, I am a pastor of a small church. I am 67 years old. I am trying to learn to program an address book for our church lay people. I am using the a book titled, “Beginning Visual Basic 6 Database Programming” by John Connell. I managed to get along with it somehow until I tried to print the address book. I used Crystal Report Pro 4.6. I can only get it to print one record in the database. Has anyone any knowledge how to force it to print all additional records?
My code to call the report is below.

 [/inlinecode]Private Sub cmdPrint_Click()
CrystalReport1.Action = 1 'force Crystal Reports Pro to run report
End Sub 

There are no instructions in the book for printing reports.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation: ryan_vietnow is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 68
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Help with Print Reports VB 6

  #2  
Oct 14th, 2007
sir, just add this before the crystalreport1.action=1:
CrystalReport1.SqlQuery="Select * from table";

*table is the name of the table of your database you want to print.

Good luck to your programming and to your church!!
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: Dr.Del is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dr.Del Dr.Del is offline Offline
Newbie Poster

Re: Help with Print Reports VB 6

  #3  
Oct 15th, 2007
Originally Posted by ryan_vietnow View Post
sir, just add this before the crystalreport1.action=1:
CrystalReport1.SqlQuery="Select * from table";

*table is the name of the table of your database you want to print.

Good luck to your programming and to your church!!



Still didn't work. I don't think the additional info is being recorded in the database.

[code] Use
  1. Private Sub cmdPrint_Click()
  2.  
  3. CrystalReport1.SQLQuery = "Select*from Contacts"
  4. CrystalReport1.Action = 1 'force Crystal Reports Pro to run report"
  5.  
  6. End Sub
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: Dr.Del is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dr.Del Dr.Del is offline Offline
Newbie Poster

Re: Help with Print Reports VB 6

  #4  
Nov 10th, 2007
Originally Posted by ryan_vietnow View Post
sir, just add this before the crystalreport1.action=1:
CrystalReport1.SqlQuery="Select * from table";

*table is the name of the table of your database you want to print.

Good luck to your programming and to your church!!
CrystalReport1.SqlQuery="Select * from table";

This doesn't work. Does ; need to be there?
Reply With Quote  
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation: ryan_vietnow is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 68
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Help with Print Reports VB 6

  #5  
Nov 12th, 2007
oh i'm sorry,it isn't supposed to be there,just delete it.
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: Dr.Del is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dr.Del Dr.Del is offline Offline
Newbie Poster

Re: Help with Print Reports VB 6

  #6  
Nov 12th, 2007
[code) Private Sub cmdPrint_Click()

CrystalReport1.SQLQuery = "Select * from Contacts"
CrystalReport1.Action = 1 'force Crystal Reports Pro to run report"

End Sub [/code]

This works before the application is compiled, packaged, distributed, and installed. However, after that, it won't refresh new records in the print option. The records do appear
to be in the database on the form, but not in the print preview box. I'm at the point where I would be willing to pay to get this information.

DrDel
Reply With Quote  
Join Date: Jan 2008
Posts: 1
Reputation: pncookson is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pncookson pncookson is offline Offline
Newbie Poster

Help Re: Help with Print Reports VB 6

  #7  
Jan 7th, 2008
Hi,

It just occured to me that you may be putting the data in the header section instead of the detail section.

That would explain why you have 1 record showing.

Hope this helps.

Paul Cookson
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: Dr.Del is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Dr.Del Dr.Del is offline Offline
Newbie Poster

Re: Help with Print Reports VB 6

  #8  
Jan 19th, 2008
I will have a new look at it in a day or so.

Thank you
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 4:44 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC