Lock data entry in Form

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

Guest

I have a combo box - Status- with active-closed. when set to "closed" i want
to lock the data entry for this record.
 
In the combobox's AfterUpdate event, put:

Me.AllowEdits=(Me.Status = "Active")
Me.AllowAdditions=Me.AllowEdits
Me.AllowDeletions=Me.AllowEdit

Barry
 
Hi Barry,
Thanks for your help, it works - but when I reopen the data base the record
set to "close" can be edit again. Any further thoughts?
jorg
 
When you say the record can be edited again, do you mean through the form or
are you trying to edit it in the table?

This code doesn't affect the ability to edit the record, it just changes
properties on the form when the record is displayed. The code basically says,
if the status column on the current record is "active", allow edits,
otherwise don't.

Barry
 
When you say the record can be edited again, do you mean through the form or
are you trying to edit it in the table?

This code doesn't affect the ability to edit the record, it just changes
properties on the form when the record is displayed. The code basically says,
if the status column on the current record is "active", allow edits,
otherwise don't.

Barry
 
Through the form. also once "closed†is applied all other records are also
not edible.
 
Ok. You should put this code in the form's OnCurrent event as well.

Barry
 

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

Back
Top