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 |
#11
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|