prevent data from being changed

  • Thread starter Thread starter Dan
  • Start date Start date
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
 
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
 
Back
Top