If record is "approved", do not allow edits or deletions.

A

Annette

I have an approved field on a form, that once a name is populated in
the approved field I would like to turn off allowedits and
allowdeletions.

I was using this code:
With Me
.AllowEdits = (Me.ApprovedByID = 1)
.AllowDeletions = Me.AllowEdits
Me.frmTimeDetail.Enabled = Me.AllowEdits
Me.frmTimeDetail.Locked = Not Me.AllowEdits
End With

So, if I entered an ApprovedByID other than 1, I expected the form to
not allow for edits or deletes. This was not true. I could still
change other fields on the form (with the exception of the
frmTimeDetail) subform. Once I exited the record and came back to the
form, sure enough I could not change the fields. How can I make that
happen sooner -- do I need to issue a save to get it to take effect?

Any other suggestions to do this process? Basically, if someone
approves the time record, I do not want it to ever get changed.

Thanks!
 
B

bcap

Put the code in the form's AfterUpdate event also (or, better, put it in a
general procedure and call it from the two event procedures).
 

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