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

Lock all input fields on a form?

Status
Not open for further replies.

kayek

Programmer
Jun 19, 2003
95
US

I want to be able to lock all the input fields on a form. Is there some way to do that with a command or do I have to lock each of the objects separately?

In my table I have a column called lock. If lock is set to true then I want everything on the form to be locked. I want my users to be able to view the form and data but if it is locked they should not be able to update anything on the form.

The form has over 50 input fields. I know I can check for the lock and then lock each of the fields with a some code but I am trying to avoid having to lock each one individually. Is there some way I can lock the entire form?
 
This is more a forms question than Access Modules/VBA coding, isn't it (forum702).

That said, there are form properties (allowadditions, allowedits...) that can be manipulated through the properties dialog or some small snippets, or you could address the form controls "wholesale" - some approaches of form control looping can be found here faq702-5010

Roy-Vidar
 
Hi!

Try this:

If Lock = True Then
Me.AllowEdits = False
Me.AllowAdditions = False
End If

This will lock the entire form and anything on it.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top