Making a bound form editable or not based on a yes/no column within record

mamradzelvy

Member
Local time
Today, 19:31
Joined
Apr 14, 2020
Messages
145
Hello,
I'm trying to make my Edit form lock it's txt boxes based on a yes/no value within the currently displayed record, is that possible?
 
Yes - on the current event something like
If me.chkLocked then Me.Form.AllowEdits = False Else Me.Form.AllowEdits = True end if
This will lock everything.
If you want to be more selective you'll probably need to use the tag property and cycle through your controls.
 
Last edited:
add code to the Current Event of the form:

private sub form_current
me.textboxToLock.Locked = (Me.YesNoTextbox)
end sub
 
You might want to put the code in the AfterUpdate event of the yes/no control as well.
 
You might want to put the code in the AfterUpdate event of the yes/no control as well.
Not in this case...as soon as you checked the box, you'd realize that you forgot to enter something...or had made a mistake that needed correcting!

More importantly...you can't set AllowEdits to False for a Record you are currently entering data into...it would only take effect as you moved to another Record...try it!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom