Refresh form to first tab (1 Viewer)

tinyevil777

Registered User.
Local time
Today, 20:03
Joined
Dec 10, 2010
Messages
137
Afternoon all.

Very simple one i'm sure...

I have a form that's using the TabStrip function. I have three tabs;
  1. Details
  2. Tasks
  3. Attachments
Along the bottom of each of these tabs are "Next Record" and "Previous Record" functions. However, when you select one of these, instead of the "Details" tab being selected (the default tab) it stays on whatever tab you were viewing.

I've tried setting a requery function to the "on click" code of the record selectors, but that just sends the record selection to the first record of the database.

Am i missing something really simple here?

Thank you in advance!

Tom
 

MarkK

bit cruncher
Local time
Today, 12:03
Joined
Mar 17, 2004
Messages
8,181
If you want to run code when a record navigation occurs handle the Form_Current event.
To make a tab page current you can set the value property of the tab control to the PageIndex value of the page you want to make current, or you can run the SetFocus method of the tab page object.
Examples...
Code:
Private Sub Form_Current()
[COLOR="Green"]  'select the first page in the pages collection of the tab[/COLOR]
  me.tab.value = 0
[COLOR="Green"]  'select a page by name and run its SetFocus method[/COLOR]
  me.tab.pages("pgNamedTabPage").setfocus
End Sub
Cheers,
Mark
 

Users who are viewing this thread

Top Bottom