Requery Form when Activated

music_al

Registered User.
Local time
Today, 00:27
Joined
Nov 23, 2007
Messages
200
I have a form which takes its data from a query. When that form is activated I would like the form to requery its data.

I am using the OnActivate event but for some strange reason, the form isn't picking up the new record that is definitely there when I just run the query itself.

Code:
    Forms!splitform_RRARs_Approved.Form.Requery
    Forms!splitform_RRARs_Approved.Refresh

Any ideas what might be going wrong ?
 
It seems that if I click save after Ive updated the data that the query is run over and then go into the form - the additional records are there.

So, how do I force a save in the source record set ? I tried DoComd.Save but I get an error.
 
It is normally because you are still in the record and it hasn't saved yet. One easy check is to put a button on the form that requeries the data, this will confirm this.
 
Whilst in the form where the data is updated, use
Code:
If Me.Dirty Then Me.Dirty=False
 
So, Isladogs, so you mean the form where I am CHANGING the data or in the form that is fed by the query ?

And that is your line of code above actually doing ? I've never used the DIRTY thing before.
 
and where do I put that line of code ? What event ?
 
The Dirty property is set to true whenever a records data is changed. So you would use that code to force a save on the form where the data is changed.

You can use it on whatever event on that form is going to fire after you have added the record. If necessary add a "save" button to force the save and requery of the other form.
 

Users who are viewing this thread

Back
Top Bottom