Locking all fields

  • Thread starter Thread starter Mari
  • Start date Start date
M

Mari

I need to lock and unlock all the fields on a form and several subforms on
the fly. Any suggestions?

Thanks!
 
Create a sub

private sub LockFields()
with me
..field.locked = true
..field2.locked = true
..field3.locked= true
end with
end sub

privat sub unLockFields()
with me
..field.locked = false
..field1.locked = false
..fields3.locked = false
end with
ens sub

Associate these subs with the respective events.

form suborms the syntax is

[form].[subform]!fields.control

The ! is critical.

HTH

MW
 
Thanks for the response. That's pretty much the code I'm using now ... I
guess I should have been more specific. There are so many fields in this
database that I was hoping there was a sort of "universal" lock that would
take care of all the fields at once, sort of like form.locked = true.



Matt Weyland said:
Create a sub

private sub LockFields()
with me
.field.locked = true
.field2.locked = true
.field3.locked= true
end with
end sub

privat sub unLockFields()
with me
.field.locked = false
.field1.locked = false
.fields3.locked = false
end with
ens sub

Associate these subs with the respective events.

form suborms the syntax is

[form].[subform]!fields.control

The ! is critical.

HTH

MW


-----Original Message-----
I need to lock and unlock all the fields on a form and several subforms on
the fly. Any suggestions?

Thanks!



.
 
I use the below in on current you might like to try it.

AllowEdits = False
AllowAdditions = False
AllowDeletions = False

Les


Mari said:
Thanks for the response. That's pretty much the code I'm using now ... I
guess I should have been more specific. There are so many fields in this
database that I was hoping there was a sort of "universal" lock that would
take care of all the fields at once, sort of like form.locked = true.



Matt Weyland said:
Create a sub

private sub LockFields()
with me
.field.locked = true
.field2.locked = true
.field3.locked= true
end with
end sub

privat sub unLockFields()
with me
.field.locked = false
.field1.locked = false
.fields3.locked = false
end with
ens sub

Associate these subs with the respective events.

form suborms the syntax is

[form].[subform]!fields.control

The ! is critical.

HTH

MW


-----Original Message-----
I need to lock and unlock all the fields on a form and several subforms on
the fly. Any suggestions?

Thanks!



.
 
Back
Top