Why are runtime property changes saved?

  • Thread starter Thread starter Rob Rutherford
  • Start date Start date
R

Rob Rutherford

I'm using Access 2002 and sometimes find that changes made at runtime to the properties of a form and its controls are saved when I
save the form. Why does this happen and can I turn it off?
 
At the bottom of Property sheet of a Form, you will find "Allow Design
Changes". The Default is "All Views". Change it to "Design View Only"
 
If you close the form with:
DoCmd.Close acForm, Me.Name, acSaveNo
the changes are not saved.

However, there are several ways a form can be closed (X on title bar,
control box, closing Access, Close from File menu, etc), that this is
generally impractical. You may want to use the Open event of the form to
ensure that the controls are set up the way you intend.
 
Thanks George. Are you sure about this? I don't know exactly
when the effect I mentioned occurs because I can't reproduce it
to order, but I'm fairly sure that I had the 'Allow Design Changes'
property set to 'Design View Only' when the runtime changes were
saved.

Regards,
Rob Rutherford
 
Thanks Allen. I assume this means that there is no option I can turn off.
Do you know what causes it? I seem unable to reproduce it to order and
as far as I know this never happened when I was using Access 97.

Regards,
Rob Rutherford
 
No, it's not just a matter of turning off an option.

Not clear exactly what you are doing, but I've found it safest to code up
the init condition in Form_Open in any version. It is just too easy for you,
as the developer to switch a form to design view, make a change, and end up
saving the wrong conditions.

For example, if you set the visible property of Textbox2 in the AfterUpdate
property of Textbox1, you would code this in Form_Open or FormLoad:
Call Textbox1_AfterUpdate
 
Back
Top