HELP Tab Order

  • Thread starter Thread starter ym
  • Start date Start date
Y

ym

Hello,

My form has 3 TAB controls. THe first TAB "Report Information" has about 18
textboxes/combox which I am using code to change the position of various
controls and set some to invisible/visible depending who is opening this
form.

The user needs to be able to navigate from one control to the next in the
order the controls are displayed using the Tab KEY.

How do I achieve this ?? I have done lots of googling today and
unfortunately I am not getting close to getting a solution.

This site has been of great help to me in the past but most recently I don't
get any response at all.

Please help....
 
With the form open in Design mode, select View | Tab Order from the menu bar
and you can set your order.
 
Hi Doug,

This won't work for me because a control for this user login maybe Tab Order
= 1 and Tab Order = 15 for another user.

I need to be able to handle this in code. Please, any advise.
 
ym said:
Hi Doug,

This won't work for me because a control for this user login maybe Tab Order =
1 and Tab Order = 15 for another user.

Please explain why that would be the case. If you conditionally hide a control
it is automatically removed from the tab sequence. Why would you want to
display the same controls but impose a different tab order?
 
Hi Rick,

THe layout for both types of user login.

In Design Mode, the controls can be anywhere on the form. I have to use
code to specifically place controls in the right position for user TYPE 1 &
2 interface.

I thought the solution is to use in code the [control] .tabindex to set the
tab order for both interface which I did and it not work for me. During
runtime, when I tried to tab from one control to next, it was taking its own
course all over the screen.

Would appreciate your help in pointing out if what I am doing is wrong and
how I should get it right. Please let me know if I am not explaning myself
well.

Thanks in advance.

====================================================
For user login TYPE 1 :

[txtTrack Number] [txtDate Received] [cboSource Report]

[cboSourceName] [txtSourceNumber] [txtRC ID]

[cboReport Type] [cboProvince] [cboAssigned]

[txtPat ID] [cboReport Type] [cboProvince]

[SubFOrm] [txtNumberR]

[txtPat
ID]

====================================================
For user login TYPE 2 :

[txtTrack Number] [txtDate Received] [cboSource Report]
[cboMethod Receipt]

[txtPat ID] [cboReport Type] [cboProvince]
[checkbox 1]

[checkbox 2]

[SubFOrm]
[option 1]

[option 2]
========================================================
 
ym said:
Hi Rick,

THe layout for both types of user login.

In Design Mode, the controls can be anywhere on the form. I have to use code
to specifically place controls in the right position for user TYPE 1 & 2
interface.

I thought the solution is to use in code the [control] .tabindex to set the
tab order for both interface which I did and it not work for me. During
runtime, when I tried to tab from one control to next, it was taking its own
course all over the screen.

Generally you have to set the order from highest to lowest. Is that what you're
doing?
 
Hi Rick,

I looked at the Tab Order box, the order of the controls right now is set to
first the top and then left to right in order of controls layout on the form
is Design Mode.

In my code, here is how I set the tabindex.

Sub TYPE1

DoCmd.OpenForm stDocName

Forms![Adverse Reaction Report]!trackingnumber.TabIndex = 0
Forms![Adverse Reaction Report]!txtDate.TabIndex = 1
Forms![Adverse Reaction Report]!cboSourceType.TabIndex = 2

Forms![Adverse Reaction Report]!cboSourceName.TabIndex = 3
Forms![Adverse Reaction Report]!txtSourceNumber.TabIndex = 4
Forms![Adverse Reaction Report]!txtRCTrackingNumber.TabIndex = 5
......
.....
End Sub

You mentioned set the order from highest to lowest. I do not know what is
this - could you explain please.

Thanx

Rick Brandt said:
ym said:
Hi Rick,

THe layout for both types of user login.

In Design Mode, the controls can be anywhere on the form. I have to use
code to specifically place controls in the right position for user TYPE 1
& 2 interface.

I thought the solution is to use in code the [control] .tabindex to set
the tab order for both interface which I did and it not work for me.
During runtime, when I tried to tab from one control to next, it was
taking its own course all over the screen.

Generally you have to set the order from highest to lowest. Is that what
you're doing?
 
ym said:
Hi Rick,

I looked at the Tab Order box, the order of the controls right now is set to
first the top and then left to right in order of controls layout on the form
is Design Mode.

In my code, here is how I set the tabindex.

Sub TYPE1

DoCmd.OpenForm stDocName

Forms![Adverse Reaction Report]!trackingnumber.TabIndex = 0
Forms![Adverse Reaction Report]!txtDate.TabIndex = 1
Forms![Adverse Reaction Report]!cboSourceType.TabIndex = 2

Forms![Adverse Reaction Report]!cboSourceName.TabIndex = 3
Forms![Adverse Reaction Report]!txtSourceNumber.TabIndex = 4
Forms![Adverse Reaction Report]!txtRCTrackingNumber.TabIndex = 5
......
.....
End Sub

You mentioned set the order from highest to lowest. I do not know what is
this - could you explain please.

What I meant is you could try...

DoCmd.OpenForm stDocName

Forms![Adverse Reaction Report]!txtRCTrackingNumber.TabIndex = 5
Forms![Adverse Reaction Report]!txtSourceNumber.TabIndex = 4
Forms![Adverse Reaction Report]!cboSourceName.TabIndex = 3
Forms![Adverse Reaction Report]!cboSourceType.TabIndex = 2
Forms![Adverse Reaction Report]!txtDate.TabIndex = 1
Forms![Adverse Reaction Report]!trackingnumber.TabIndex = 0

I don't know if that will make any difference, but often the reshuffling
caused by changing an ordinal setting causes problems unless you traverse
them backwards.
 
will try this and update you after..

Rick Brandt said:
ym said:
Hi Rick,

I looked at the Tab Order box, the order of the controls right now is
set
to
first the top and then left to right in order of controls layout on the form
is Design Mode.

In my code, here is how I set the tabindex.

Sub TYPE1

DoCmd.OpenForm stDocName

Forms![Adverse Reaction Report]!trackingnumber.TabIndex = 0
Forms![Adverse Reaction Report]!txtDate.TabIndex = 1
Forms![Adverse Reaction Report]!cboSourceType.TabIndex = 2

Forms![Adverse Reaction Report]!cboSourceName.TabIndex = 3
Forms![Adverse Reaction Report]!txtSourceNumber.TabIndex = 4
Forms![Adverse Reaction Report]!txtRCTrackingNumber.TabIndex = 5
......
.....
End Sub

You mentioned set the order from highest to lowest. I do not know what is
this - could you explain please.

What I meant is you could try...

DoCmd.OpenForm stDocName

Forms![Adverse Reaction Report]!txtRCTrackingNumber.TabIndex = 5
Forms![Adverse Reaction Report]!txtSourceNumber.TabIndex = 4
Forms![Adverse Reaction Report]!cboSourceName.TabIndex = 3
Forms![Adverse Reaction Report]!cboSourceType.TabIndex = 2
Forms![Adverse Reaction Report]!txtDate.TabIndex = 1
Forms![Adverse Reaction Report]!trackingnumber.TabIndex = 0

I don't know if that will make any difference, but often the reshuffling
caused by changing an ordinal setting causes problems unless you traverse
them backwards.
 
Back
Top