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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabbed Control selection to set subform recordset

Status
Not open for further replies.

ekim

Technical User
May 9, 2001
71
US
I have a tabbed control with three tabbed pages. I want to use the same subform on each tabbed page and just filter the recordset through a reference in the underlying query criterion. I know I could do it with an option group but I'd like to do it with selected tab -- either directly on the query or, if need be, selecting different queries for the form recordsource. Couldn't seem to find anything with keyword search except thread 702-817317 (which looks promising). Am posting in case someone can illuminate my dim bulb here. Any help would be appreciated.
 
Hmm, if you don't want to use option group, and don't want to directly just have the user click the tabs, can you not do through a combo box with a select case statement? I use that for a form.. something like:
Code:
cmbMyComboBox_AfterUpdate()
  Dim strVariable as String
  strVariable = cmbMyComboBox
  Select Case cmbMyComboBox
    Case "Value1"
      Tab1.Visible = True
      Tab2.Visible = False
      Tab3.Visible = False
    Case "Value2"
      Tab1.Visible = False
      Tab2.Visible = True
      Tab3.Visible = False
    Case "Value3"
      Tab1.Visible = False
      Tab2.Visible = False
      Tab3.Visible = True
  End Select
End Sub

Any help there?

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Thanks Stephen

Perhaps I did not describe my situation clearly. I was actually wanting to use an event that fired when they selected a tab. I was unaware that one could refer to a page on a tab control directly like that. Times before I would create stacked forms to emulate the tabed control and then use the visible property as you suggest. I was trying to use the actual tab control and become more familiar with how to manipulate its properties and the properties of the pages on it.


I am taking a hint from the thread I mentioned above and am making some headway but it seems convoluted and perhaps made so by my ignorance of the syntax and properties to use. Was hoping for more direct solution. Thanks for your help.
 
Yep, you can run an event in a tab(page) event. The events are:
On Click
On Dbl Click
On Mouse Down
On Mouse Move
On Mouse Up

Pretty much the same as what are on a label, so you should have no problem setting an event for them based on mouse movement/clicking.

To find them, just right click on any tap, choose properties, then events. Just make sure you are looking at an individual tab, and not the tab set.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top