If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Going to a specific tab
I have a tabbed form that have "Clubs" and "Grocery", etc that opens up when
the user clicks on Club field or Grocery field or the other opeing in the main form. I been trying to go to specific tab based on which field was clicked - ie click on Club the form opens up with the CLUB tab on display, Click on grocery and the GROCERY tab will on displayed, etc. I've tried everything but the form still opens up with CLUBS (being the first tab) even if you click on the Grocery, Warehouse, etc. Need help please. |
#2
|
|||
|
|||
Going to a specific tab
Pass the field that was clicked to the tabbed form as the OpenArgs value.
Then, in the Open eventof the tbbed form, check the OpenArg value and set the tabcontrol's value to display the appropriate page. Something like: In the main form's click event for a particular field ... DoCmd.OpenForm "frmTabbedForm", , , , , , "Club" 'substitute the appropriate field name for the different field's click events ... and in the tabbed form's Open event Select Case OpenArgs Case "Club" Me.ctlTab.Value = 0 'assuming Club tab is 0; change as appropriate Case "Grocery" Me.ctlTab.Value = 1 'assuming Grocery tab is 1; change as appropriate ... Case Else Me.ctlTab.Value = 0 'default to tab page 0 End Select HTH, Rob "mmmbl" wrote in message ... I have a tabbed form that have "Clubs" and "Grocery", etc that opens up when the user clicks on Club field or Grocery field or the other opeing in the main form. I been trying to go to specific tab based on which field was clicked - ie click on Club the form opens up with the CLUB tab on display, Click on grocery and the GROCERY tab will on displayed, etc. I've tried everything but the form still opens up with CLUBS (being the first tab) even if you click on the Grocery, Warehouse, etc. Need help please. |
#3
|
|||
|
|||
Going to a specific tab
You can't use a tab control's CLICK event reliably as it is almost useless
because it won't actually fire from the tab part. You need to use the On Change event of the tab control to determine which tab was clicked and then to do whatever code you need. -- Bob Larson Access World Forums Super Moderator ____________________________________ If my post was helpful to you, please rate the post. "Rob Parker" wrote: Pass the field that was clicked to the tabbed form as the OpenArgs value. Then, in the Open eventof the tbbed form, check the OpenArg value and set the tabcontrol's value to display the appropriate page. Something like: In the main form's click event for a particular field ... DoCmd.OpenForm "frmTabbedForm", , , , , , "Club" 'substitute the appropriate field name for the different field's click events ... and in the tabbed form's Open event Select Case OpenArgs Case "Club" Me.ctlTab.Value = 0 'assuming Club tab is 0; change as appropriate Case "Grocery" Me.ctlTab.Value = 1 'assuming Grocery tab is 1; change as appropriate ... Case Else Me.ctlTab.Value = 0 'default to tab page 0 End Select HTH, Rob "mmmbl" wrote in message ... I have a tabbed form that have "Clubs" and "Grocery", etc that opens up when the user clicks on Club field or Grocery field or the other opeing in the main form. I been trying to go to specific tab based on which field was clicked - ie click on Club the form opens up with the CLUB tab on display, Click on grocery and the GROCERY tab will on displayed, etc. I've tried everything but the form still opens up with CLUBS (being the first tab) even if you click on the Grocery, Warehouse, etc. Need help please. |
#4
|
|||
|
|||
Going to a specific tab
Hi Bob,
The OP is clicking in a field on the main form to open the tabbed form; that's the Click event I'm referring to. Neither the OP nor I have referred to the Click event of a tab control. Rob "boblarson" wrote in message ... You can't use a tab control's CLICK event reliably as it is almost useless because it won't actually fire from the tab part. You need to use the On Change event of the tab control to determine which tab was clicked and then to do whatever code you need. -- Bob Larson Access World Forums Super Moderator ____________________________________ If my post was helpful to you, please rate the post. "Rob Parker" wrote: Pass the field that was clicked to the tabbed form as the OpenArgs value. Then, in the Open eventof the tbbed form, check the OpenArg value and set the tabcontrol's value to display the appropriate page. Something like: In the main form's click event for a particular field ... DoCmd.OpenForm "frmTabbedForm", , , , , , "Club" 'substitute the appropriate field name for the different field's click events ... and in the tabbed form's Open event Select Case OpenArgs Case "Club" Me.ctlTab.Value = 0 'assuming Club tab is 0; change as appropriate Case "Grocery" Me.ctlTab.Value = 1 'assuming Grocery tab is 1; change as appropriate ... Case Else Me.ctlTab.Value = 0 'default to tab page 0 End Select HTH, Rob "mmmbl" wrote in message ... I have a tabbed form that have "Clubs" and "Grocery", etc that opens up when the user clicks on Club field or Grocery field or the other opeing in the main form. I been trying to go to specific tab based on which field was clicked - ie click on Club the form opens up with the CLUB tab on display, Click on grocery and the GROCERY tab will on displayed, etc. I've tried everything but the form still opens up with CLUBS (being the first tab) even if you click on the Grocery, Warehouse, etc. Need help please. |
#5
|
|||
|
|||
Going to a specific tab
That fixed the problem thank you!
"Rob Parker" wrote: Hi Bob, The OP is clicking in a field on the main form to open the tabbed form; that's the Click event I'm referring to. Neither the OP nor I have referred to the Click event of a tab control. Rob "boblarson" wrote in message ... You can't use a tab control's CLICK event reliably as it is almost useless because it won't actually fire from the tab part. You need to use the On Change event of the tab control to determine which tab was clicked and then to do whatever code you need. -- Bob Larson Access World Forums Super Moderator ____________________________________ If my post was helpful to you, please rate the post. "Rob Parker" wrote: Pass the field that was clicked to the tabbed form as the OpenArgs value. Then, in the Open eventof the tbbed form, check the OpenArg value and set the tabcontrol's value to display the appropriate page. Something like: In the main form's click event for a particular field ... DoCmd.OpenForm "frmTabbedForm", , , , , , "Club" 'substitute the appropriate field name for the different field's click events ... and in the tabbed form's Open event Select Case OpenArgs Case "Club" Me.ctlTab.Value = 0 'assuming Club tab is 0; change as appropriate Case "Grocery" Me.ctlTab.Value = 1 'assuming Grocery tab is 1; change as appropriate ... Case Else Me.ctlTab.Value = 0 'default to tab page 0 End Select HTH, Rob "mmmbl" wrote in message ... I have a tabbed form that have "Clubs" and "Grocery", etc that opens up when the user clicks on Club field or Grocery field or the other opeing in the main form. I been trying to go to specific tab based on which field was clicked - ie click on Club the form opens up with the CLUB tab on display, Click on grocery and the GROCERY tab will on displayed, etc. I've tried everything but the form still opens up with CLUBS (being the first tab) even if you click on the Grocery, Warehouse, etc. Need help please. |
Thread Tools | |
Display Modes | |
|
|