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

locking and unlocking a form

Status
Not open for further replies.

MJD1

Technical User
Jul 18, 2003
134
CA
hi all, I've got a form for which I want users to open, view records with the ability to add, edit or delete records only when an "edit button" is clicked. Essentially, I need to learn how to lock and unlock all the fields in a form.

any help is appreciated!

martin
 
You can change the AllowEdits, AllowAdditions and AllowDeletions if the form is bound.

Alternatively you can use something like this:

Code:
   On Error Resume Next

   Dim MyCtrl as Access.Control

   For Each MyCtrl in Me.Controls
      MyCtrl.Enabled=False
      MyCtrl.Locked=True
   Next MyCtrl

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks for the help, the below put me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top