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 ©
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top