Requery subform in tab

hughess7

Registered User.
Local time
Today, 00:34
Joined
Dec 2, 2010
Messages
27
Hi all, I have a main form called Activity Log which has four tabs on it. Each tab has a different subform. When one form has a date entered it alters information (actions) on another tab via code. When the user then clicks on the Action tab I want the latest to display. I assumed I needed to requery this subform which is Named ActionLog (name not source object) and tried by entering the following code on the onclick event of the Actions tab:

Forms![Activity Log]![ActionLog].Form.Requery

but it doesn't show the latest data. If I close the main form and reopen the Actions are correct so I know the data is changing correctly. Thanks in advance for any help...
 
The On Click event of the tab control is almost useless. You need the On Change event of the main tab control to determine the page you just changed to.

Code:
Select Me.TabControlNameHere.Pages(Me.TabControlNameHere).Name
Case "PageNamehere"
   ' do whatever here
Case "Another Page NameHere"
   ' do something else
Case Else
   Msgbox "This page has not been accounted for, please contact your administrator"
End Select
 
Thank you sooo much Bob! That worked now using your example and adding my requery code. Great stuff and thanks for the quick reply! Most appreciated :-)
 

Users who are viewing this thread

Back
Top Bottom