Requery subform

T

Theresa

I have a main form which contains 2 subforms on a tab control. Both subforms
are based on the same query. When I add records to the subform on the first
tab, some information should automatically populate the subform on the 2nd
tab. If I close the form and reopen it, or go to design view and back to
form view, the query is re-run and the 2nd subform refreshes. I have tried
putting me.requery as an event procedure in the tab control on change event,
but it still does not work. What am I doing wrong?
 
K

Ken Snell [MVP]

You need to requery the subform, not the main form. In your code on the Tab
control's Change event, use this:

Me.NameOfControlHoldingSubform.Form.Requery
 

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