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

Lock Field on Form

Status
Not open for further replies.

nickotine

Programmer
Nov 27, 2001
23
GB
Hi,
I want to be able once a value has been entered into a field on a Form LOCK a different field on the same Form to prevent data entry. What would be the best solution. Expression, Macro? and most important how do I do it?

Cheers,

Nickotine.
 
Try using the On Change event procedure on field 1.
using something like this.

If Me.Field1.Value Is Not Null Then Me.Field2.Locked = True

The above is okay then you are inputing, but do you then need access to lock Field 2 if there is something in field 1.

If this is the case you need to added something like the following to the On Current Event procedure of your form.

If Me.Field1.Value Is Not Null Then Me.Field2.Locked = True
If Me.Field1.Value Is Null Then Me.Field2.Locked = False

Hope this helps

Never smile at work, they may think you're enjoying yourself too much and cut your pay.
 
Hi Bob,
Thanks for the reply, but I still have a problem the Formula doesn't seem to work. This is what I did.

Created On change Event Procedure on Field1. Used the Formula and Tested but it didn't Lock Field 2.

Both Fields on the Form update the same Table.
 

While your form is in design view, left click on the control on the control you want to lock. The editing box will appear.

Right click. Then click on properties. Click on the data tab. Click in the locked row. Change it to yes.



Judge Hopkins

"...like hunting skunks underwater...."
John Steinbeck, The Grapes of Wrath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top