tab control position when opening form

J

Julie

I have a form with a tab control that contains several pages. On some of the
pages I have a button that opens another form and closes the form with the
tab control. I want to be able to return to the same page on the tab control
the next time the original form is opened. Is this possible?
 
P

Pat Hartman

Open the form and then set focus to the tab page. I always name my tab
pages and tab controls to something relevant so they say something other
than page85 which has no meaning.

DoCmd.OpenForm "frmRisks", , , "RiskID = " & Me.lstRiskID
Forms!frmRisks!TabCtlRisksForm.Pages("pgSegment").SetFocus
 
J

Julie

That works. Is there a way to tell it to open to the last tab viewed by the
user (setting up some sort of memory for the form)? I'm guessing not, but
thought I'd ask.

Thanks
 
L

Linq Adams via AccessMonster.com

Easy way:
As part of your button assign the page name to a global variable and then
check the variable when re-opening the form, then setting focus to the
appropriate page.

Harder way:
Have a table with a field to hold the page name
As part of your button write an update query to assign the page name to the
field
On re-opening the form use DLookup to check the field, setting focus to the
appropriate page.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 

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