Locking Fields

vcarrill

Registered User.
Local time
Today, 11:37
Joined
Aug 22, 2019
Messages
62
Question:

I have a field called "PartID" which has exclusive information. I need this field to be locked, and accessible only when entering a new PartID, then locked afterwards.

Is there a way to do this?

Thank you!
 
If you're using forms, there is a Locked property you can use. You can also use Conditional Formatting for this.
 
"Locked property you can use." - I locked the field. How do I unlock it to add a new partid? Other than access the property sheet and manually unlocking it then locking it again?

You can also use Conditional Formatting for this. - What would I enter here?
 
"Locked property you can use." - I locked the field. How do I unlock it to add a new partid? Other than access the property sheet and manually unlocking it then locking it again?

You can also use Conditional Formatting for this. - What would I enter here?

Hi. For conditional formatting, try

Value is: Not Null

Sent from phone...
 
Last edited:
Could something like this work?

If Me.NewRecord Then
Me.Part ID.Locked = False
Else
Me.Part ID.Locked = True
End If
 
Could something like this work?

If Me.NewRecord Then
Me.Part ID.Locked = False
Else
Me.Part ID.Locked = True
End If

Yes, if you put it in the Form's Current event.

PS. By the way, if your field's name has a space, you'll have to enclose it in square brackets.
 
Just to make sure, this is also a REQUIRED field for the form? Hate to have someone put in all the data but not the part ID, then find they can't enter it.
 
If in form current event the test is for content (i.e. Null or "") then you don't have to check for new record:

Code:
If Nz(Me.[Part ID],"") = "" Then
 Me.[Part ID].Locked = False
Else
   Me.[Part ID].Locked = True
End If
 

Users who are viewing this thread

Back
Top Bottom