Prevent edits on specific controls

tmyers

Well-known member
Local time
Today, 06:01
Joined
Sep 8, 2020
Messages
1,091
I am trying to prevent changes to specific controls when a record is not new to prevent accidental editing and to have more control over when an edit occurs. Is there a way to check on a form if the record is new and if not, locked and disable a series of controls along with changing their background to be grayed out to represent the fact they cant be used? All the controls on the form I wish to "lock" are text boxes with the exception of one which is a combo if that matters.

Would I use Me.NewRecord to check if the record is new then re-enable the controls then if it returns false, disable them?
 
Most people use the Tag property for anything like this.
Set that property for your controls and then loop through and disable/lock is whatever you use as keyword is found.
And yes, Me.NewRecord would be the property to check.
 
In the current event check for Me.NewRecord.

You can then set the controls Enabled property to No, that will grey it out and disable it in one fell swoop.
You can use the various controls tag property to loop around them in one go.
 
The tag you two reference, is that the "Tag" property in the Other tab at the bottom in 2016?
 

Users who are viewing this thread

Back
Top Bottom