Subform will not requery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a subform. On the main form I have a command button that
imports an excel file into the table that is the RecordSource of the Form and
imports an excel file into the table that is the RecordSource of the SubForm.
After the import process I do Me.Requery and the Form requeries but the
SubForm does not. So I added Me.SubformObjectName.Requery but I still do not
see the records in the subform. If I close the Form and then reopen it I
see the subform records. What am I not doing correctly? I want to see the
subform records right after the import.

Thank you for your help.

Steven
 
you do have to requery the subform separately. try

Me!SubformControlName.Form.Requery

make sure you're using the name of the subform control within the main form,
not the name of the subform object as it appears in the database window.
sometimes the two names are the same, but sometimes they're different
(depending on how the subform was created).

hth
 
Tina,

Still does not work. Can you think of something else that it might be?

Thanks,

Steven
 
no. that's the correct way to requery a subform using code within the main
form. are you sure you're referencing the subform control correctly?

hth
 
Back
Top