lock record using conditional formating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

How do you lock a record when using conditional formating? I am using
conditional formating on the primary auto number when i close the record the
number change to red. I also have a subform link to that record. I want to
lock the record to prevent anyone from changing the billing number, how do i
create a code for it?

thank you
Bessie
 
You need to use code to lock the fields or the sub form with the condition
you are using in the conditional formating

On the OnCurrent event of the form, add the code
If [Enter here your Condition] then
me.FieldName.Locked = True
Me.SubFormName.Locked = True
Else
me.FieldName.Locked = True
Me.SubFormName.Locked = True
End if
================================
Also if you update a field in the form, and depend on the value you entered,
you want to lock the fields, then add the code above to the after update
event of that field
 
Back
Top