Locking & Unlocking Form

G

Guest

Hey all,
I have a form for filling in a Payment. Once a payment has been completed
the user "Submits" it so it affects their account. When it has been submitted
the form is locked so they cannot change that Payment.
I also have some record navigation buttons on the form which allows the user
to view past payments made.
The problem I have is when the user goes to a record (Payment) which has
been submitted, the form needs to be locked, then when they go to one which
is not submitted it needs to be unlocked so they can complete it.
Obviously I can do this through unlocking, locking the form on all of the
navigation buttons event handlers and also when the form opens and when a new
payment is created.
Is there an easier way around this? Rather than having to call a procedure
on many different buttons. Just trying to streamline here I guess, does one
of the forms event handlers allow me to run the lock check procedure once its
been refreshed or something?
Thanks in advance.

Ash.
 
S

Scott McDaniel

Hey all,
I have a form for filling in a Payment. Once a payment has been completed
the user "Submits" it so it affects their account. When it has been submitted
the form is locked so they cannot change that Payment.
I also have some record navigation buttons on the form which allows the user
to view past payments made.
The problem I have is when the user goes to a record (Payment) which has
been submitted, the form needs to be locked, then when they go to one which
is not submitted it needs to be unlocked so they can complete it.
Obviously I can do this through unlocking, locking the form on all of the
navigation buttons event handlers and also when the form opens and when a new
payment is created.
Is there an easier way around this? Rather than having to call a procedure
on many different buttons. Just trying to streamline here I guess, does one
of the forms event handlers allow me to run the lock check procedure once its
been refreshed or something?

The AfterUpdate event is run immediately after your form has been updated (i.e. saved).

The Current event is run every time a user moves from one record to another.

One of those should do what you want. You can set the form's AllowEdits and AllowDeletions properties to lock/unlock the
form globally. Of course this may also lock some features that you wish for the user to interact with, in which case
you'd need to loop through the controls and lock only those you wish.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
G

Guest

QUOTE:
"The Current event is run every time a user moves from one record to another."

Excellent, that sounds like the thing I am after. And yes you're right about
the fact of not locking all controls. I already have a procedure which loops
through them locking only those I want to.

Thanks very much for your help.
Cheers,
Ash.
 

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