View Full Version : locking fields


Anauz
03-07-2001, 08:22 AM
Is there a way i can group fields together and lock them via the grouping option rather that locke them individullay. I have over 60 fields and need to lock/unlock depending on the action being performed ie add/edit

I can open the form in red only mode using
code -

DoCmd.OpenForm stDocName, , , , acFormReadOnly

code -

but that locks all the fields and need some unlocked so i can choose which record to view via the drop down box

thanx in advance

llkhoutx
03-07-2001, 01:10 PM
On some event, lock them all at one time.

Anauz
03-08-2001, 02:16 AM
thats the problem.......i don't want to write code to lock 60 or so different fields individully. I was wondering if there was a better way of doing it.

Atomic Shrimp
03-08-2001, 02:28 AM
I don't know if this helps, but what about if you started with them all locked by default, then only unlocked the relevant ones?

Mike

Anauz
03-08-2001, 02:46 AM
tried that as well Mike

DoCmd.OpenForm stDocName, , , , acFormReadOnly
locks all the fields. Then I tried to unlock some fields using Forms!formname!fieldsname.locked = false
it seems to ignore that code and keep the al the fields locked

Atomic Shrimp
03-08-2001, 03:38 AM
I mean locking them all by editing their properties in design view, then unlocking some of them in code as appropriate.