How to stop user from changing data

R

Roger

My users have figured out that they can edit and change the price field on my
checkout screen subform. This allows them to charge any amount they wnt to a
client. How can I lock this so the price is what is reflected in the service
or retail table as set by the owner. The price field comes from a cloumn in a
combo box.
 
B

Beetle

Open the form in design view, open the properties sheet for the control
in question, and set the following properties (on the Data tab);

Enabled = No
Locked = Yes

Setting the enabled property to No will "gray out" the control, so if you
don't
want that, just set the locked property.
 
R

Roger

Setting the property to locked prevents me from selecting / entering any item
from the combo box. I need to be able to select the service but not let the
user change the price. The price comes from a column in the combo box based
 
S

Stockwell43

Hi Roger,

Did you disable AND lock the field? If so, enable the field but just lock
it. Are they change the CBO which is changing your price field? Or, are they
going into the price field and changing it there? If the latter, locking the
field should have not affect of the CBO unless it's different for subforms. I
have a textbox locked that feeds from a CBO and when I chagne the selection
in the CBO the textbox updates as well.

If they are changing your CBO, you may have to password protect that field
so that ONLY the users that need to update that field have the password to
enable it.
 
R

Roger

They are highlighting the price field on the form and changing that not the
amount from the frop down in combo box. I just locked field and not disabled
but that prevents me from being able to enter data from the combo as well.
Roger
 
B

Beetle

If you have an unbound text box on your form with a control source
of something like;

=[YourComboBox].Column(3)

Then locking the unbound text box will not affect it's ability to display
the value from Column(3) of the combo box. Locking a control only prevents
direct editing of that control. It does not prevent programatically editing
the value.

How exactly are you getting the value that is displayed in the text box?
 
S

Stockwell43

When you make a selection from the drop down, does it automatically fill in a
price in the price field textbox?

Do the prices that fill the price field correspond to a specific selection
from the drop down? In other words, if you select bread from the drop down
the price field automatically fills in $2.00, if you select milk it fills in
$1.50 and so. If this is the case, you could code you drop down so that on a
certain selcetion your price field automatically fills in with that price.
THEN you can lock the field. However, you run into the problem of someone
changing the drop down from bread to milk unless they would leave the product
alone. There are probably many ways to do this but this is how I have done it
and seems to work well for me.
 
R

Roger

Thanks for your help. I was locking the combo not the price field it is
working now
Roger
 

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