need help with applying a condition

M

Mike O'Brien

Derek,

Not sure what fields you are referring to...you didn't
list them. This code snippet will lock all textboxes on a
form:

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
ctl.Locked = Not ctl.Locked
End If
Next ctl

You can specify different textboxes by using ctl.Name = ""
instead of the For...Each...Next construct

HTH

Mike ©
 
Top