Which event fires on requery? (1 Viewer)

Ipem

Registered User.
Local time
Today, 11:23
Joined
Aug 26, 2013
Messages
29
Hello all,

I think the title of the thread sais it all. I need to run a make table query every time the user opens a specific form, or clicks on the "Refresh" button, to requery it. I have searched the net for 20 minutes, and can't find the answer.

The background:
The make query updates the values in one of the source tables of that form. I can't include the query itself in the record source, becouse than the fuelds would not be updateable. I also need to set a primary key for that table after recreating it, but that is no problem. The only problem is that I can't find a Form event, from which I could reasonably update the record source of the form itself.

Thanks for the suggestions!
 

Mihail

Registered User.
Local time
Today, 12:23
Joined
Jan 22, 2011
Messages
2,373
You can't find an answer because, as far as I know, it isn't.
Include the code you need after the requery statement.

Object.Requery
Your code here
 

Ipem

Registered User.
Local time
Today, 11:23
Joined
Aug 26, 2013
Messages
29
Thanks Mihail. So I need to make my own refresh button, and ask the users to use that instead of the bulilt in one.
This does not make life simpler, but what can I do?

Best wishes,

Ipem
 

Mihail

Registered User.
Local time
Today, 12:23
Joined
Jan 22, 2011
Messages
2,373
So I need to make my own refresh button, and ask the users to use that instead of the bulilt in one
Not exactly (but this is a solution too).

You need to requery after something is happened (a field was updated, a calculation was made etc). All this will fired an event or there are under an event.

Let's say that you hit an button in order to make a computation. This fire the Click event for that button.
Under the same Click event for the button you can include the code that refresh the form.
Something like this:
Private sub ButtonName_Click
varA=InputBox("Set the value for varA)
Me.Requery
End Sub


I assume that your form use varA in order to filter the records.
After the user, via the InputBox, set a (new) value for varA you should requery the form in order to display the actual set of records (in accord with the new value for varA)
 

Users who are viewing this thread

Top Bottom