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.

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.

Recommended Answers

All 8 Replies

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!!

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.

Use [code=language] Private Sub cmdPrint_Click()

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

End Sub

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?

oh i'm sorry,it isn't supposed to be there,just delete it.

Private Sub cmdPrint_Click()

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

End Sub

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

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

I will have a new look at it in a day or so.

Thank you

I want to print multiple Crystal Reports. Please help me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.