Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Test for which tabbed page is active on a form

Status
Not open for further replies.

Tfrank

Technical User
Jun 19, 2001
30
US
I have a form that contains tabbed page forms. I have a simple question, is there a simple test using VB that I can do that will tell me which tabbed page is selected for view by the user. On one tab page I display photo's but I would only like to update each record with the appropiate photo when that specific tab is selected. The proccess is slow for some picures that are large. So this is why I only won't to update it when neccessary.

Thanks for the help,
TFrank
 
Not sure if this will help you but have the subform on the tab unbound and make it invisible. then use the following code, but you

Private Sub TabCtl0_Change()
Select Case TabCtl0.Pages.Item(TabCtl0.Value).Name

'Case "pg1"
' If Len(sfrm1.SourceObject) = 0 Then
' sfrm1.SourceObject = "sfrm1"
sfrm1.LinkChildFields = "ID"
' sfrm1.LinkMasterFields = "ID"
' sfrm1.Visible = True
' End If
You can omit the link child fields. This will speed up the process.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top