requery a subform

G

Guest

I change the query def of a subform and then want to requery that subform.
The following code successfully changes the query def, but I'm not seeing the
subform refresh with the new data. The name of the subform is
"frmApptTemplate". What am I missing?

CurrentDb.QueryDefs("qryApptAggregate").SQL = strSQL
Me.frmApptTemplate.Form.Requery
 
C

Cindy

Change the syntax to be:
Forms![Name of Main Form]![frmApptTemplate].Form.Requery

Replace name of main form with the parent form. Also be sure that the
name of the subform OBJECT on the main form is also called
frmApptTemplate. If it's not - you need the object name rather than
the actual subform name!

Cindy
 

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

Similar Threads

requery continuour subform 11
subform based on external SQL won't requery 1
Requery subform with new SQL 4
Subform not refreshing 2
Requery not! 7
refresh/requery subform 2
subform requery 1
Requery Crosstab Subform 2

Top