subform

hrov

Registered User.
Local time
Today, 22:46
Joined
Feb 18, 2009
Messages
52
HI
I have a subform which is a query and does exactly what i want it to do.

This query has criteria, which is selected through the main form.

At the minute the query doesnt update itself straight away if some criteria is altered. However it does update if I navigate to the next record and back again.

Is there a way i can make the query requery itself once the criteria is altered.

(I have tried requerying the query on the afterupdate and on click but this doesnt seem to work).
 
(I have tried requerying the query on the afterupdate and on click but this doesnt seem to work).
What code have you tried for the requery on the after update of the other? If it is on the main form that the criteria is selected, you would need to use something like

Me.YourSubformContainerName.Form.Requery
 
And the .FORM. part stays exactly as shown (don't replace it with some form name but it stays as .form. )
 
And the .FORM. part stays exactly as shown (don't replace it with some form name but it stays as .form. )
thanks for the reply

but i cant get it to work still.

my query is named "qryevpb". But the subform that has this as its source is named "child 128".

Am i right in thinking that the code should be

Code:
 Me.Child94.Form.Requery

And I am putting this code in the after update property if the dropdown box that would change the criteria of the query. If this is correct what could be wrong?
 
thanks for the reply

but i cant get it to work still.

my query is named "qryevpb". But the subform that has this as its source is named "child 128".

Am i right in thinking that the code should be

Code:
 Me.Child94.Form.Requery

And I am putting this code in the after update property if the dropdown box that would change the criteria of the query. If this is correct what could be wrong?
Where's the combo box that you are selecting from? Is that on the other subform (the one with Child128)? If so then it would actually be

Me.Parent.Child94.Form.Requery
 
Where's the combo box that you are selecting from? Is that on the other subform (the one with Child128)? If so then it would actually be

Me.Parent.Child94.Form.Requery
Everything is on the ONE form.

A combobox acts as criteria for a query.

To show the user what is happeneing i have used this query and put it in a sub report.

But if the combobox/criteria is altered then the subform/query does not update automatically. Instead i have to manually go to the next record and then the previous record to get back to the correct record which is now updated.

Maybe i will just put a simple macro in that skips between the records (next, then previous) this would proberbly do what i am looking for?
 
Can you post the database? I just gotta see this. It is hard to visualize from the description.
 
Solved my problem hrov Bob was right just hadn't got my syntax right.... :eek::o

Forms!Form1!frmsubCOSHHSummary1.Form.Requery was missing a ! used . after form1 so not correct arrgggghhh. :D
 
Can you post the database? I just gotta see this. It is hard to visualize from the description.
I would but i would have to alter some sensitive data first so would only be prepare to do it if i was very desperate but i have sorted it a different way.

Thanks a lot for helping
 

Users who are viewing this thread

Back
Top Bottom