Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Crystal Report 8 datasource at runtime using VB

Status
Not open for further replies.

kco1122

Programmer
Nov 16, 2000
3
US
As others, I'm trying to set unbound fields in a crystal report to dynamic sourced recordsets. I've done what the manuals and books say:

Code:
dim report as new crystalreport1
set report = new crystalreport1

report.datasource.setdatasource recData
(recdata being the recordset of data)

crystalreport1.strfname = "(ado.firstname)"

But this also leads me to a '
Code:
subscript out of range error
' when it reached the "
Code:
report.datasource...
etc..) line. Why is this? I (among others) could really use a hand here...

If it helps, I run this process on a command button click and at the end of all this, load the form with the report viewer that is tied into the report I want (being this one).

Should I be doing this in the load event for the form of the report viewer??? Someone please help before this drives me insane!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top