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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports Called from Visual Basic Does Not Display Data

Status
Not open for further replies.

dasmit89

Programmer
Jul 9, 2004
4
US
I have a form that when it opens, deletes all the records from a table, and then allows the user fills in data to a table. When the user enters all of the records, they click a command button which checks the information (potentially deleting "blank records") in the table and opens the report to print it with the table as the recordsource.

Unfortunately, every time I call the report from my visual basic code (when the user clicks a button in my form), the data does not get displayed -- the form is blank and other data based on lookups get #Error. If I then manually do a print preview of the report, all of the data shows up fine.

Any help/suggestions would be appreciated as I am going stir crazy with this one.
 
Just a guess, but it sounds like the data isn't being "refreshed" before your code is launching the report.
 
I tried refreshing the form, but I still have the same problem. I also tried closing the input form and only printing the report when it returned to the original form calling the input form, but I get the same error. Interestingly, when I have another subform that fills a different table and runs a report, I don't encounter this problem.

Again, any helpful suggestions would be appreciated.
 
How are you passing the data to the report ? Are you calling the report using a query/table as part of the parameter or are you creating a recordset first ?

It may be a good idea to post a copy of your code here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top