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  

Open form to third tab



 
 
Thread Tools Display Modes
  #11  
Old December 13th, 2007, 11:09 PM posted to microsoft.public.access.forms
Doctor
external usenet poster
 
Posts: 75
Default Open form to third tab

You guys are awesome!

Super!


"Klatuu" wrote:

Use the actual name of the tab control. That was just an example.
--
Dave Hargis, Microsoft Access MVP


"Doctor" wrote:

Great! This is what I am looking for.

Error: it is giving an error on MyTabControl.

Is this supposed to stand for something? Am I supposed to put the name of
the page in this place?

Almost there.

"Klatuu" wrote:

I did not read the entire post, sorry, here is the amended code

First in the button Click event, pass a string value to the form in the
OpenArgs argument.

DoCmd.OpenForm "MyFormName", , , , , ,"Yes"

Then, in the Load event:

If Me.OpenArgs = "Yes" Then
Me.MyTabControl.Pages(2).SetFocus
End If



--
Dave Hargis, Microsoft Access MVP


"Doctor" wrote:

Thanks for the fast reply!

I'm so new to VB. Where and how do I code your idea?

First, where do I place the public variable and how do I code it.

Then, to make sure you understand my question, I don't want the form to open
to the third tab everytime...only when the button in the first form is
clicked. I think that's what you meant. just wanted to be sure.

"Dennis" wrote:

You need to use the tabCtl for the form you're opening. Personally, I'd place
the desired tab number into a PUBLIC variable, then, on the new form's "On
Activate" event, set the 'tabCtl' to the value in the public var. Works like
a charm.

  #12  
Old December 13th, 2007, 11:15 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Open form to third tab

Glad I could help
--
Dave Hargis, Microsoft Access MVP


"Doctor" wrote:

You guys are awesome!

Super!


"Klatuu" wrote:

Use the actual name of the tab control. That was just an example.
--
Dave Hargis, Microsoft Access MVP


"Doctor" wrote:

Great! This is what I am looking for.

Error: it is giving an error on MyTabControl.

Is this supposed to stand for something? Am I supposed to put the name of
the page in this place?

Almost there.

"Klatuu" wrote:

I did not read the entire post, sorry, here is the amended code

First in the button Click event, pass a string value to the form in the
OpenArgs argument.

DoCmd.OpenForm "MyFormName", , , , , ,"Yes"

Then, in the Load event:

If Me.OpenArgs = "Yes" Then
Me.MyTabControl.Pages(2).SetFocus
End If



--
Dave Hargis, Microsoft Access MVP


"Doctor" wrote:

Thanks for the fast reply!

I'm so new to VB. Where and how do I code your idea?

First, where do I place the public variable and how do I code it.

Then, to make sure you understand my question, I don't want the form to open
to the third tab everytime...only when the button in the first form is
clicked. I think that's what you meant. just wanted to be sure.

"Dennis" wrote:

You need to use the tabCtl for the form you're opening. Personally, I'd place
the desired tab number into a PUBLIC variable, then, on the new form's "On
Activate" event, set the 'tabCtl' to the value in the public var. Works like
a charm.

 




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 07:28 AM.


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