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

Error in running report

Status
Not open for further replies.

TimSzrejter

Programmer
Feb 13, 2001
18
US
I have a report that is running very erratic. Sometimes it will populate and sometimes it will come up #Error in all the fields.
The front end database contains the report and all the code. When the report opens a sub procedure is run which populates a worktable in the front end app. The front end has a few tables that are linked to a backend db on our server, which is where it pulls the data that is put into the worktable. Sometimes I can run this report and everything works ok. Other times the report comes up in preview mode with #Error in all the fields. When I go to the worktable, however, all the records are filled in like they should be. Another thing that I have noticed is that if I step through the code then the report will always run correctly. I was thinking there may be a timing issue. I've tried DoEvents in various stages of my code. Does anyone have any suggestions?

Thanks,
Tim Szrejter
 
We don't have a whole bunch of choices there for report "opening" events do we. I'll agree this is a timing problem. If you start the report from say, a command button, you might try something like this:

YourTablepopulatingCode
DoCmd.OpenReport "YourReportName", acViewPreview
Reports!YourReportName.Visible = False
Reports!YourReportName.Visible = True

Sometimes the "kick" from invisible to visible does wonders. Worth a try?
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top