Since you want this to occur when you first open the form why not [blue]disable the controls (default) in design view[/blue] and save yourself the code? . . .
AceMan - I assume that at some point he'll want to enable the controls (else why have them) so either way he will need the looping code (either to enable or disable).
Thanks for responding. I found an example from another site. Sorry I didn't get back sooner. Posted the code below just for the hell of it.
Private Sub Form_Open(Cancel As Integer)
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox
If ctl.Name Like "*Emp" Then
ctl.Enabled = True
Else
ctl.Enabled = False
End If
End Select
Next
Me.Emp.SetFocus
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.