Locking data in a completed form

J

Jeff Woiton

What I am looking to do is lock data in a form once the form is
complete. Others can see the contents of the form, but they can't make
changes to it. Dorpdowns and text boxes become just text labels,
calculations don't update, and Save is disabled.

Here's the larger picture: I'm a sales manager for a manufacturing
company, and I created a simple form for doing sales quotes. It embeds
a database that has all of our products, so if you click on a product
from a dropdown, it brings up part number and price, multiplies price
by quantity, figures in discounts, tax, shipping, the works (and thanks
again for all the help I got from this ng to complete that).

Now what I want to do is "carve it in stone" so that if anyone pulls up
the form, they can view it in InfoPath but can't screw it up by making
changes to the original sales quote. Maybe something like a
non-printable button that says, "carve in stone" which would convert
the contents of certain fields into text.

Can do?
 
F

Franck Dauché

Yes you can do it.

1 way is to have a node in your schema to hold a true/false value for
read-only (defaulting to false). Once someone click on your "Set in Stone"
button, the flag would turn to true. If you add conditional formatting to
each of your controls, you can make them read only if the read-only flag is
true.

Another way is to set the default View to be displayed by code. This is
even better. Once the flag I described above has been set yo "true", the
default View of your IP form can switch to a View where each control is read
only and in which date pickers are texboxes, etc.

A third way is to purely by code behind, where you cancel any changes in
your form in the OnBeforeChange event.

Hope that it gets you started.

Franck Dauché
 
Top