A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Going to a specific tab



 
 
Thread Tools Display Modes
  #1  
Old October 24th, 2007, 01:36 AM posted to microsoft.public.access.forms
mmmbl
external usenet poster
 
Posts: 15
Default 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  
Old October 24th, 2007, 06:33 AM posted to microsoft.public.access.forms
Rob Parker
external usenet poster
 
Posts: 701
Default 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  
Old October 24th, 2007, 08:14 AM posted to microsoft.public.access.forms
boblarson
external usenet poster
 
Posts: 886
Default 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  
Old October 24th, 2007, 08:21 AM posted to microsoft.public.access.forms
Rob Parker
external usenet poster
 
Posts: 701
Default 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  
Old October 24th, 2007, 07:32 PM posted to microsoft.public.access.forms
mmmbl
external usenet poster
 
Posts: 15
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.