In addition to the above information, I would like to say that I can edit
other records, but once I have passed that record either forwards or
backwards (e.g. if it is the 3rd record, I can edit records 4 onwards, but
once I go passed it backwards to record 1, I can't edit any records. If I
edit the record back again (in a copy of the form which doesn't have the
above code in On Current), I get everything back to normal. However, I need
this lock to work, and only on the relevant records.
Thank you for any help.
"Owl" wrote:
> I have read all I can find but still can't get this right. I have a combo
> box with a selection of either Yes or No in a field called P5Pd and I want to
> lock records if it Yes is selected.
>
> I have the following code, but it is locking ALL records and not just if
> P5Pd = "Yes"
>
> Sub Form_Current()
> If Me.P5Pd = "Yes" Then
> Me.AllowEdits = False
> End If
> End Sub
>
|