Update subforms on tabs when clicked

garywood84

Registered User.
Local time
Today, 02:51
Joined
Apr 12, 2006
Messages
168
I have two subforms on two tabs on a form in my Database. I need these subforms to update (requery) when the tab they are on is clicked, so that any changes made on one tab will be reflected on the other, when it becomes the active tab.

Please can anyone advise me how to do this? I have tried to do it using an OnClick event on the tab, but it's not working out.

Thanks,

Gary
 
Gary:

As you have found out, the On Click event of a tab on the tab control is not useful at all. In fact it only works if you click on the part of the tab that isn't the tab (useful, eh?). So you need the On Change event of the tab control itself.

You can test to see which tab has been selected by using
Code:
Select Case MyTabControlNameHere.Value

Case 0
   Me.YourSubformContainer1.Form.Requery
Case 1
   Me.YourSubformContainer2.Form.Requery
Case 2
   Me.YourSubformContainer3.Form.Requery
Case Else
'   Whatever
End Select
 
Thanks, Bob - it's now working perfectly!
 

Users who are viewing this thread

Back
Top Bottom