"Bookmark" tab for moving to next record

D

DonReid

I have a multi-page form, using a tab control. When users are viewing a
record, they may select any of these tabs, each of which has a subform that
relates to the form on the first page. When the user moves to the next
record (using the nav bar), I would like them to stay on the same tab (page)
that they had open on the previous record -- the current default behaviour is
to set the focus to the first page of the tab control
 
D

Dale Fye

Don,

Whenever you select a new tab, record the current page in a variable that is
declared in the general declarations section of the forms code module.

Then, in the forms Current event, add some code that sets the tab to the
particular tab you had previously selected.

HTH
Dale
 
D

DonReid

Thanks Dale, I've done that, but the act of moving to the next record also
fires the tab control's onchange event, resetting the variable -- that I have
just set -- to zero, and thus changing me back to the first tab....
 
D

DonReid

Dale, disregard my last post and thanks again for your help. I had written a
procedure on the main form's oncurrent event that forced the focus back to
the first tab. Your solution was what I needed -- without my other extra
code.

Thanks again.

Don
 
D

Dale Fye

Don,

Glad I could help.

From your description, I would bet that your form probably loads rather
slowly. This would be due to the numerous subforms (one on each tab). I've
found that it is much quicker to load only one subform at a time, since you
can only use one tab at a time anyway. The way I do this is to create the
subform outside the tab control and then position it over the tab control.
By doing this, the subform is not actually linked to the tab, but to the
form, although it will sit over top of the tab control and appear to be
linked to the control. Then, when you click on a particular tab, have some
code that changes the subforms source object.

Since you are only loading one subform at a time, this is much quicker,
especially if you have a lot of tabs.

HTH
Dale
 

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