requery a subform

S

smk23

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

Top