Subform will not requery

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
 
T

tina

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
 
G

Guest

Tina,

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

Thanks,

Steven
 
T

tina

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
 

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