Opening a form with tabs, to a specified tab.

MsfStl

Registered User.
Local time
Today, 10:16
Joined
Aug 31, 2004
Messages
74
I have a survey DB with many forms, several of these have tabs. If for some reason there was a cutoff in the survey I save the form name and question name (which is always the first Ques on any form, or the tabctl value) into FormSE and QueS, respectively, so I can return directly to that spot later on. On the forms without tabs I use the following code to open the forms:

stDocName = FormSE
stLinkCriteria = "[RespID]=" & RID
'Respondent ID
DoCmd.OpenForm stDocName, , , stLinkCriteria

However, for those forms with tabs of course the form opens on the first page always. The tabctl0.value was saved into a variable called QueS, similar to the FormSE variable in the above code, which houses the form name.

How can I open the tabbed forms to the correct page (or tab)?
 
stDocName = FormSE
stLinkCriteria = "[RespID]=" & RID 'Respondent ID
DoCmd.OpenForm stDocName, , , stLinkCriteria

Forms!MyFormName.TabCtl0.Pages(QueS).SetFocus
 
Very nice, thanks Sergeant!
 

Users who are viewing this thread

Back
Top Bottom