you can leave the subforms you don't need blank.
remove the subform record source.
then all you need is to set it , if a user clicks that page of the tab. there is a click event for the page.
something like
subdetails!sourceobject = "underlyingform"
subdetails.requery
Oh man, if you (or anyone else) can help me with this, I would greatly greatly appreciate that.
Can you provide me with with the full code? I am assuming that the above code goes into the on click event of each page of the tab control?
Attached is all the tabs I got.
You also mentioned in one of your earlier posts that I can choose to not have the sunforms loaded until they click the tab. I looked it up and wanted to try this code (below)
But if there is also a way to do an on click event which is much simpler that I want to do that. last night I almost thought of re-doing the whole thing and create 7 separate forms vs the tabs but I dont want to go that route.
http://www.pcreview.co.uk/threads/i...bforms-on-tabs-only-when-tab-clicked.1149237/
"When I
design a complex for this way, my onChange event also clears the
SourceObject of the subform that is being hidden. Here's some sample code -
note that on each of the cases instead of using absolute page numbers I get
the page number by getting the pageindex of a named page. I do this because
the page index of a page changes if you reorder the pages but I tend to
leave the names alone once I've set them. This just reduces maintenance and
prevents weird errors when you reorder the pages but forget to adjust the
code."
'Module level variable
Private mIntCurTabPage As Integer
Private Sub TabCtl8_Change()
'Clear the SourceObject of subform on tabpage we're leaving
Select Case mIntCurTabPage
Case Me.TabCtl8.Pages("pgFirstPageName").PageIndex
Me.sfrmFirst.SourceObject = vbNullString
Case Me.TabCtl8.Pages("pgSecondPageName").PageIndex
Me.sfrmSecond.SourceObject = vbNullString
Case Me.TabCtl8.Pages("pgThirdPageName").PageIndex
Me.sfrmThird.SourceObject = vbNullString
Case Me.TabCtl8.Pages("pgFourthPageName").PageIndex
Me.sfrmFourth.SourceObject = vbNullString
End Select
Select Case Me.TabCtl8
Case Me.TabCtl8.Pages("pgFirstPageName").PageIndex
Me.sfrmFirst.SourceObject = "sfrmOrders"
Case Me.TabCtl8.Pages("pgSecondPageName").PageIndex
Me.sfrmSecond.SourceObject = "sfrmOrders2"
Case Me.TabCtl8.Pages("pgThirdPageName").PageIndex
Me.sfrmThird.SourceObject = "sfrmOrders3"
Case Me.TabCtl8.Pages("pgFourthPageName").PageIndex
Me.sfrmFourth.SourceObject = "sfrmOrders4"
End Select
mIntCurTabPage = Me.TabCtl8
End Sub