Query Not Refreshing

SueBK

Registered User.
Local time
Today, 23:35
Joined
Apr 2, 2009
Messages
197
I have just had an occurence that doesn't make any sense to me at all. My offsider was entering information via a form. The information is used in a query to feed a report. He noticed that the data in the report hadn't updated.

Easy fix, thinks I - exit the form to ensure the table is up dated; refresh the query. No so easy. Even after closing the database down the query was still showing the wrong information.

I checked the tables in the backend - correct information. I created a new query based on the same data - correct information. Old query - still incorrect data. I also checked that the fields in the query were the fields I thought they were in the table - all good.

I have fixed it by simply deleting the old query and starting again, but I'm wondering what would cause such an issue?
 
The form hasn't been updated. The form gets updated when you move to another record or force it to save using code.

How is the report being opened? Via a button on the form?
 
The report does open from a button on the form, but the query doesn't. I was opening the query the hard way (looking for it in the list of queries). Even after closing the database down and reopening it the query was still showing the wrong information.
 
Just before you open the report, you need to run this code:

If Me.Dirty Then Me.Dirty = False

that will force save.
 
Although I fixed the problem by creating a new query, I will be saving this very handy tip for future reference. Thank you.
 

Users who are viewing this thread

Back
Top Bottom