requery a subform

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top