TabStop

bmhuettinger

Registered User.
Local time
Today, 14:34
Joined
Jul 28, 2017
Messages
59
Hi! I have a form that has approximately 100 controls but I only need 10 tab stops. Is there anyway to set the tab stop setting to "no" in the property sheet, en masse, and then add it back in to the 10 controls? Thank you!
 
Have the property sheet open, highlight all the controls (not labels). On the propertysheet other tab change Tab Stop from Yes to No
 
Have the property sheet open, highlight all the controls (not labels). On the property sheet other tab change Tab Stop from Yes to No

As CJ_London implied, labels don't have a tab stop property but nor do several other properties such as lines, rectangles

These control types do have tab stops:
acCommandButton, acTextBox, acListBox, acTabCtl, acPage, acCheckBox, acSubform, acBoundObjectFrame, acOptionGroup

I may have missed one or two types...

NOTE: the tab stop command only works if the control is enabled for obvious reasons

I missed the blindingly obvious & instead tried to do this using code by adding the following to the Form_Load event

Code:
For Each ctl In Me.Controls
    
        Select Case ctl.ControlType
        
        Case acCommandButton, acTextBox, acListBox, acTabCtl, acPage, acCheckBox, acSubform, acBoundObjectFrame, acOptionGroup

          '  Debug.Print ctl.Name
            If ctl.enabled = True Then ctl.TabStop = False
        
        Case Else
            'do nothing
            
        End Select
    Next ctl

It works in the sense that all tab stops are disabled for the lifetime of the form BUT the property of each control doesn't change.
In other words, remove the code & the tab stops work again
 

Users who are viewing this thread

Back
Top Bottom