Locking fields for one record on a continuous form

da poet

Registered User.
Local time
Today, 03:34
Joined
Aug 23, 2004
Messages
39
How can i apply the following code to the immediate record in my subform. I would like when the assigned check box value = true, then the fields for that record become locked.

Ive written the following code to an onclick event for a check box labeled "assigned" on my form, the problem is it executes on all the records in my form.

Q. How do i apply the code to only the immediate record?


Private Sub Assigned_Click()
If Me.Assigned.Value = True Then
Me.Serial_Number.Enabled = False
Me.Component_Group_ID.Enabled = False
Me.TypeID.Enabled = False
Me.Description.Enabled = False
Me.Status.Enabled = False

Else
Me.Serial_Number.Enabled = True
Me.Component_Group_ID.Enabled = True
Me.TypeID.Enabled = True
Me.Description.Enabled = True
Me.Status.Enabled = True

End If

End Sub
 
Thanks for the reply. It turns out that i did add the exact code that i posted earlier to the forms Current event, it doesnt work how it should actually. It keeps locking all the records.

Please advise
 

Users who are viewing this thread

Back
Top Bottom