Access 2003 Macro Question: How to set focus to a specific tab on a tab control within an existing macro?

I am trying to edit an existing Access database macro to include a new item.
I did not create it, and I am not sure how to add to it.
The macro itself appears not in raw code, but in a screen that lists all macros associated with the form.  Here is what is shown:

Macro Name                                  Action
CreateNewContact: On Click        GoToRecord

There is only this one action currently in this macro.
The details for the GoToRecord are as follows:
Object Type:  Form
Object Name:  Contacts
Record:  New

So, currently, when the macro runs, it will place you on a new record in the contact form.

This is what I want, but in addition to this, after placed on the new record, I want to place the user on a specific page on a tab control.

What do I need to add to place them on the page I want in the tab control?
Who is Participating?
sah18Author Commented:
Ahhh, I solved this myself.  In case others need to do this:
Just add an additional row beneath the previous action.
Select "GoToControl", and then type in the TabPage name in the control text box.
Is this a button in the form that creates a new record?

If so, then What I would do is Create a new Button using the Wizard to "Create new Record"
Then go in and Edit the On Click Event and add to the Code

me.TAB PAGE NAME.setfocus
BTW if the Wizard isn't working for you, the Wizard Generated Code is as follows:
 DoCmd.GoToRecord , , acNewRec
sah18Author Commented:
it is a button that already exists on the form, that launches the macro.  I don't really want to re-create the button, as it is already fine the way it is.  I just want to add to the macro code.  Is there a way to have more than one line of code for the macro in that Macros screen that I described above?
Closed, 500 points refunded.
EE Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.