prevent data from being changed

D

Dan

I want my form to load so that you can't change any
information in the records and if you want to change some
information then you have to click a button and then
change the data. I was wondering what property would do
this. Is there a property for the general form, so that I
don't have to set it on every single text box
 
R

Rick Brandt

Dan said:
I want my form to load so that you can't change any
information in the records and if you want to change some
information then you have to click a button and then
change the data. I was wondering what property would do
this. Is there a property for the general form, so that I
don't have to set it on every single text box

You can set the AllowEdits property to false and the entire form will be
locked. The problem with this is if your form includes any unbound
controls that you still want to use as they will be locked also. For
example, it is fairly common to include an unbound ComboBox on a form to
use in navigating to other records. That ComboBox would also be unusable
with AllowEdits set to false.

You can lock all of your individual data controls with a fairly simple loop
process. I usually give all of the controls I want to lock a common Tag
property entry (like "Lock") and then use code similar to...

Dim cnt as Control

For Each cnt in Me
If cnt.Tag = "Lock" then cnt.Locked = True
Next cnt
 

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