tab order

sandrao

Registered User.
Local time
Today, 15:38
Joined
Sep 6, 2007
Messages
34
Is there any way to turn a tab sequence on and off. I need to keep serveral controls out of the normal tab order from most of the agents. Only a few agents have a need to enter data in these fields. Perhaps a double click in the control could turn on the tab order for these seperate controls.

Any Ideas
 
I don't know of any way to turn Tab stops on and off, but you could make these controls available/unavailable a number of ways. One way would be to use the Windows User Names to decide. This code only gives access to the control MyDateField if the User Name is Linq or Puck.

Code:
Private Sub Form_Load()

If Environ("UserName") = "Linq" Or Environ("UserName") = "Puck" Then
  Me.MyDateField.Enabled = True
Else
     Me.MyDateField.Enabled = False
End If

End Sub
This will gray out the controls for unauthorized users, and the tab will pass over it. Or you could use the same general idea to to move focus to so as to "pass over" these controls. Where AllowedField is the last control, Tab Order-wise, before a disallowed field. Instead of going to the next Tab Stop, it goes to NextAllowedField.

Code:
Private Sub AllowedField_LostFocus()
If Environ("UserName") <> "Linq" And Environ("UserName") <> "Puck" Then
  Me.NextAllowedField.SetFocus
End If
End Sub

Linq ;0)>
 
To go with what Linq wrote - If you use

Me.MyDateField.Enabled = False
Me.MyDateField.Locked = True

Then it will not be enabled AND it WON'T be grayed out if you didn't want it to be and it would not be available as a tab stop.
 
I also found out that the control could be use to turn off or on

e.g. Me.controlname.TabStop = True

it also works FYI

thanks for you replys
 

Users who are viewing this thread

Back
Top Bottom