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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle Tabbing Off and On

Status
Not open for further replies.

Carenne

Programmer
Sep 17, 2000
27
US
I have a form with several fields which I would like the users to be able to easily toggle back and forth as to whether they want to automatically tab there or not during the data entry, without having to go into design mode to change the settings. Can I do this with controls on the form somehow? [sig][/sig]
 
If I understand you, the action you need to accomplish is only restricted to this form. Lets say you have 10 fields on the form, 6 of them are the most common ones to deal with. The other 4 only get used in certain instances. I use this approach in one of my forms. The user hits ( Alt+M ) if they need to get into the other 4 fields. By using the form Key Down Event I trap the Alt+M key strokes and use code to set the TabStop property to True for the fields you want to enable tabbing into. The form current event is used to turn off this feature.

Private Sub Form_Current()
Me.YourFieldName.TabStop = False
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'trap the hot keys for extended form field access
If KeyCode = 77 And Shift = acAltMask Then
Me.YourFieldName.TabStop = True
End If
End Sub
[sig]<p>John A. Gilman<br><a href=mailto:gms@uslink.net>gms@uslink.net</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top