lock record using conditional formating

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top