Lock field with a check box

I've done that but if I make the control source of the check box the "Serial Number" field, the serial number field changes to a -1 when click the check box.
 
I've done that but if I make the control source of the check box the "Serial Number" field, the serial number field changes to a -1 when click the check box.
jdraw, please advise. I'm going to be away for a little while.
 
jdraw: is there a better way for me to explain what I have and what I need to do?
 
pwicr,
I've just come back from shopping and saw your note.

I believe a solution to your issue is to add a field to your table. The data type would be boolean, and the name could be something meaningful to you. For example, let's call it blnMyFlag

So in the Form's Current event you would have something like

Private Sub Form_Current() ' -1 means True/Yes
If Me.blnMyFlag.Value = -1 Then
Me.YourFieldName.Locked = True
End If
End Sub

and in the field's after update

Private Sub blnMyFlag_AfterUpdate()
If Me.blnMyFlag.Value = -1 Then
Me.YourFieldName.Locked = True
End If
End Sub

And in the form design, the blnMyFlag will appear in the Fields list, drag that field down to where you want your checkbox.

I have attached a sample from my database, the table is called Employee, and the boolean field is IsSuper.

I hope this is helpful.
 

Attachments

  • pwicr0.jpg
    pwicr0.jpg
    62 KB · Views: 82

Users who are viewing this thread

Back
Top Bottom