Requerying not working

G

Guest

I have a subform that isn't requery on demand.
The form is connected to a query that is basically created on the fly
I tried adding docmd.requery in the subform onactivate() and in the command
button that triggers the subform.
Looked on the boards for answer but nothing. Please help
 
M

Marshall Barton

Justin said:
I have a subform that isn't requery on demand.
The form is connected to a query that is basically created on the fly
I tried adding docmd.requery in the subform onactivate() and in the command
button that triggers the subform.


If you are constructing the subform's query in code and
setting its RecordSource property on the fly, then there is
no need to requery it. If you are modifying a QueryDef's
SQL property, then that's the long way around, just assign
the SQK statement to the RecordSource property.

To answer your specific question, the syntax to requery the
subform from the main form is:
Me.subformcontrol.Form.Requery
or via code in the subform:
Me.Requery
or, from anywhere:
Forms!mainform.subformcontrol.Form.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top