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

How do I lock or disable individual fields in a form?

Status
Not open for further replies.

RonQA

Technical User
Jun 24, 2007
61
US
Here is what I have toyed with:

If Check97 = True Then
Forms![CAPA Form].[CAPA Title].Locked = False
End If

Access does not like this format.

I have tried "Me.Allowedits = False" but then everything is locked.

Any ideas?

Thanks,
 
Where is the code running? Is it in the same form as the controls? What is Check97? Have you considered renaming it to something like chkLockControls?

If I understand correctly, you can use something like:
Code:
   Me.[NameOfControl].Locked = Me.chkLockControls

If you have more than one control to lock/unlock the consider typing "lock" into the tag property of the controls and use code like:
Code:
   Dim ctl As Control
   For Each ctl in Me.Controls
      If ctl.Tag = "lock"
         ctl.Locked = Me.chkLockControls
      End If
   Next


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top