Blocking edits after approval

T

tgavin

I have a form with an approval field. I need to lock the form so it can not
be edited once it has been approved. I am clueless. The few things I have
tried don't work and I don't think I am on the right track. Can someone help?

Thanks
Terri
 
N

nouryalkhatib

â€â€ÙƒØªØ¨ "tgavin said:
I have a form with an approval field. I need to lock the form so it can not
be edited once it has been approved. I am clueless. The few things I have
tried don't work and I don't think I am on the right track. Can someone
help?

Thanks
Terri noury_alkhatib
 
B

Beetle

More info please.....

What happens when a record is "approved"? Does the user click a
check box or comman button? Something else?

Do you want the entire form to be locked, or just certain controls
on the form?
 
J

John W. Vinson

I have a form with an approval field. I need to lock the form so it can not
be edited once it has been approved. I am clueless. The few things I have
tried don't work and I don't think I am on the right track. Can someone help?

Thanks
Terri

Try putting code in the Form's Current event:

Private Sub Form_Current()
Me.AllowEdits = Not(Me![Approved])
End Sub


This assumes a Yes/No field named Approved, and that if Approved is False you
want to allow editing, and if True you want to forbid it.
 
A

aaron.kempf

you should do this with a trigger in SQL Server-- what if someone runs
this outside of their zone and they disable macros??



I have a form with an approval field. I need to lock the form so it can not
be edited once it has been approved. I am clueless. The few things I have
tried don't work and I don't think I am on the right track. Can someone help?
Thanks
Terri

Try putting code in the Form's Current event:

Private Sub Form_Current()
Me.AllowEdits = Not(Me![Approved])
End Sub

This assumes a Yes/No field named Approved, and that if Approved is Falseyou
want to allow editing, and if True you want to forbid it.
 
T

Tony Toews [MVP]

tgavin said:
I have a form with an approval field. I need to lock the form so it can not
be edited once it has been approved. I am clueless. The few things I have
tried don't work and I don't think I am on the right track. Can someone help?

This code goes a bit further as it gives you a command button which
you can lock and unlock a form. Nevertheless it will give you a good
start and you can strip out what you don't need.

In some situations you may want to lock the fields on a form unless
the user explicitly choose to update the transactions. While you
could set the forms Allow Edits property to false this doesn't work
for subforms. Other wierdnesses happen but I can't recall exactly
what right at the moment. This solution shows how a call to a public
subroutine passing a few parameters handles this situation.

http://www.granite.ab.ca/access/locking_fields_on_a_form.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
L

leonardo

Tony Toews said:
This code goes a bit further as it gives you a command button which
you can lock and unlock a form. Nevertheless it will give you a good
start and you can strip out what you don't need.

In some situations you may want to lock the fields on a form unless
the user explicitly choose to update the transactions. While you
could set the forms Allow Edits property to false this doesn't work
for subforms. Other wierdnesses happen but I can't recall exactly
what right at the moment. This solution shows how a call to a public
subroutine passing a few parameters handles this situation.

http://www.granite.ab.ca/access/locking_fields_on_a_form.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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