No data on report, sometimes!

sdawson

Registered User.
Local time
Today, 23:04
Joined
Apr 22, 2003
Messages
165
Not sure if this a report or form question but here goes.
I have a form that has a number of Command Buttons that fire off various reports. When users have been entering data elsewhere or printed of some reports, some of the Command Buttons will not work correctly and reports appear with error messages and no data. If the users shuts down the db and then tries to print the reports again, evrything works OK and the correct data is printed.
I assume the queries behind each report are in some way corrupted.
Any help in getting round this would be helpful.

Thanx
 
Sounds like you are not getting the data saved before the report runs. A report's query reads data from the tables. If the data entry form has not saved the data yet, the report's query can not retrieve the data.

When you exit the database, then you are forcing all the data to get saved. That is why it works when you get back into the database. All the data has been saved.

IMHO, you should not have any data entry form's open when your "report menu/switchboard" form tries to print. This will ensure that you do things in the correct order. (Enter the data, save the data, print the data)
 
Done this. All forms are closed before the pint menus are accessed.
 
Might try adding this before the report is opened:

Code:
   ' Refresh the cache to ensure that the latest data
   ' is available.
   DBEngine.Idle dbRefreshCache
 
Tried DBEngine.Idle dbRefreshCache but no change.
Have narrowed it down a bit though.
The db has a number of Combo Boxs where the user has to select a customer.
Any attempt to run reports after a box has been opened causes the problem described in the original post.
 

Users who are viewing this thread

Back
Top Bottom