0
votes

I have several controls on this form in addition to a tab control with 3 separate pages. I want the subform(s) within each page to requery when a value is selected on the page above.

So for the purposes of explaining this..

I have an event On_Click() on a field called Address_ID. It's meant to take tha value of that ID in addition to two other IDs, Cust_ID and Location_ID, and requery the subform Order_Sub within the Orders page.

I've named the tab control pretty blandly, just tabCtl.

So far I've tried every way imaginable to reference the subform, but to no avail.

Forms!Record_Details!Orders!Orders_Sub.Requery

That doesn't work, but I assume that it should. What gives?

1
Do you have the the record/row source of the subforms set in the properties dialog? If so, are you not resetting it with the new values? - Doug Coats
The subforms each have a query record source that includes criteria to set three fields equal to three control values on the form. Those controls are set to the ID values when each of them are clicked. So I assumed that, since all controls were populated, a simple requery would suffice. - Steven
Have you tried using the AfterUpdate Event instead of click? I am assuming that the value of Address_ID changes, right? - Doug Coats
It changes on_click, that's correct. I haven't tried it on other event types. - Steven
try this Forms.Record_Details.Form.Orders_Sub.Requery - Doug Coats

1 Answers

3
votes

Steve

You do not need to reference the tab control in your code. Just reference and requery the subform itself

Forms.Record_Details.Form.Orders_Sub.Requery