OpenForm Question

J

Jean

Hi,

I am using MS ACCESS 2003, I have a form with tab control that has 10 tab
pages. Is there any way to set focus to a specific tab page using
DoCmd.OpenForm....

Here is my script:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Contacts Data Entry"

stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Any suggestion is appreciated!

Thanks

Jean
 
J

Jean

Allan,

How do you code this in the DoCmd.OpenForm function?

Thanks.

Allan Murphy said:
Set the focus to the first control on the selected tab

--
Allan Murphy
Email: (e-mail address removed)
Jean said:
Hi,

I am using MS ACCESS 2003, I have a form with tab control that has 10 tab
pages. Is there any way to set focus to a specific tab page using
DoCmd.OpenForm....

Here is my script:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Contacts Data Entry"

stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Any suggestion is appreciated!

Thanks

Jean
 
A

Allan Murphy

Jean

Using the On Open event of the form that you are opening add the following

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToControl "field name"
End Sub

Field name is the name of the field in the tab that you want open

--
Allan Murphy
Email: (e-mail address removed)

Jean said:
Allan,

How do you code this in the DoCmd.OpenForm function?

Thanks.

Allan Murphy said:
Set the focus to the first control on the selected tab

--
Allan Murphy
Email: (e-mail address removed)
Jean said:
Hi,

I am using MS ACCESS 2003, I have a form with tab control that has 10 tab
pages. Is there any way to set focus to a specific tab page using
DoCmd.OpenForm....

Here is my script:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Contacts Data Entry"

stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Any suggestion is appreciated!

Thanks

Jean
 
A

Amy Blankenship

expression.OpenForm(FormName, View, FilterName, WhereCondition, DataMode,
WindowMode, OpenArgs)

Use the OpenArgs argument to pass the fieldname to use in the Form Load
event to set the focus.

HTH;

Amy

Jean said:
Allan,

How do you code this in the DoCmd.OpenForm function?

Thanks.

Allan Murphy said:
Set the focus to the first control on the selected tab

--
Allan Murphy
Email: (e-mail address removed)
Jean said:
Hi,

I am using MS ACCESS 2003, I have a form with tab control that has 10 tab
pages. Is there any way to set focus to a specific tab page using
DoCmd.OpenForm....

Here is my script:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Contacts Data Entry"

stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Any suggestion is appreciated!

Thanks

Jean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top