Locking fields in a form

Dclucie

New member
Local time
Today, 15:42
Joined
Apr 29, 2008
Messages
1
Hi All,

I am really new to all of this and used to use excel for this stuff.... yes I know... I can hear the screems already .......... :):eek::rolleyes:

What I am trying to do is lock some fields in a form when they are entered so the data can not be changed after they move onto the next record. I think this might be done in the table but can not be sure.

Can anyone point me in the right direction? or some pointers please. Any help would be good.

Many thanks
 
Look at the "On Lost Focus" (aka "LostFocus") VBA event and "Locked" property for the field objects in question. You'll also need to set the "Locked" property back when you are done with a record (you'll need to define when that is).

Events and properties are similar to those in Excel objects.
 
Maybe you can use the NewRecord property in the oncurrent event of the form. This would check to see if the record was new and if so enable the controls, etc.

Something like:

if me.newrecord then
me!txtBox.enabled = true
end if
 
If you wanted to lock all the fields, you could go to the properties box, under "Data" change "Allow Edits" to no and "Allow Deletions" to no.

I've recently done it this way, and if I see something that needs to be changed, I just change it back to allow edits, then change it back. I found this to be the easiest way for myself.

Good luck :)
 

Users who are viewing this thread

Back
Top Bottom