Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab page question 1

Status
Not open for further replies.

MeredithPfeiffer

Technical User
Aug 28, 2006
7
US
I only know the basics on access so I am having a little trouble with my form

I have a form with several tab pages (subro, salvage, ect) on it. I am setting the tab order on my form and after I tab through the first page (subro) I want it to tab over the the next tab (salvage) and through those fields then on to the next one, but I can't seem to figure out how to do it. Does anyone know the way to do it?
 
How are ya MeredithPfeiffer . . .

[ol][li]In [blue]form design view[/blue] set the [blue]Key Preview[/blue] event to [purple]Yes[/purple].[/li]
[li]In the [blue]On Key Down[/blue] event of the [blue]last field[/blue] on page [blue]subro[/blue], copy/paste the following:
Code:
[blue]   If Shift = 0 Then
      If KeyCode = 9 Or KeyCode = 39 Then
         Me!TC1.Pages("[purple][b][i]TabPageName[/i][/b][/purple]").SetFocus
      End If
   End If[/blue]
[/li][/ol]
Thats it!

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
In Design View, open the form's property box, click the Event Tab and scroll down to Key Preview. Set it to Yes.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I will give you a star for a bit I got out of it. I used/modified the : -

If Screen.ActiveControl.Name = "LastTextboxNameInPage" Then

to

If Me.ActiveControl.Name = "ControlsName" Then

to steer event where F9 was being used in a certain control. All the best for XMAS and help during year.
 
Howdy ZOR . . .

This is getting funnier all the Time![lol]

The [blue]ActiveControl[/blue] property only works with the [blue]Screen Object[/blue] although it appears in the autolisting for forms in VBE! [lol]

I think its time to take a break and have a real Rum & Coke . . .

Calvin.gif
See Ya! . . . . . .
 
Thanks, does that mean its unsafe to use "If Me.ActiveControl.Name = "ControlsName" Then" as an event check to find within what textbox was F9 depressed in. Please answer before the rum and coke!!
 
ZOR said:
[blue] . . . does that mean its [purple]unsafe to use[/purple] If Me.ActiveControl.Name = "ControlsName" Then[/blue]
Although it does work I say yes! . . . reason being, I have 37 secnarios looged in my library where [blue]Me.ActiveControl or Me.ActiveControl.Name[/blue] wouldn't work (most of the secnarios failed when calling the property from subForms) and no answer from [blue]Microsoft[/blue] as to why! In each secnario the problem was cleared by using the [blue]Screen Object[/blue] instead!

So rather than have anyone travel this inevitable ugly path I always say it doesn't work pushing them to the [blue]Screen Object[/blue].

As backup for this if you lookup the [blue]ActiveControl[/blue] property in VBE help you'll see its specifically related to the [blue]Screen Object[/blue] and saids nothing about Form Objects! . . . Period!

[blue]Your Thoughts? . . .[/blue]





Calvin.gif
See Ya! . . . . . .
 
Thanks, I will trad cautiosly with it. Thanks again, all the best.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top