Here's my nightmare. I'm doing development on a large Access program (lots of VBA). One day I open the Access file and my forms are completely messed up. Property sheet values have changed everywhere... in the forms themselves and also in the controls.
Actually this has happened several times. One time it took a whole day to find and repair all the damage.
I suppose what I really need to do is have Form_Load code that assigns default values to all of the properties I could possibly care about, both in my forms and the controls within them.
But it would be helpful to know what is causing my properties to get overwritten in the first place. I have tried to intentionally reproduce the problem, but have had no success (or failure, depending on how you look at it).
Here is a simplified example. Say I have a form that has caption "x" and a button that changes the caption to y:
I've tried breakpoints and "bad exits" to try to get the y to "stick" (so that it's still there next time I open the Access file). But I can't seem to intentionally make it happen. Yet this is the exact type of thing that has occurred on several ocasions.
What could be the cause? Has anybody else encountered this?
Actually this has happened several times. One time it took a whole day to find and repair all the damage.
I suppose what I really need to do is have Form_Load code that assigns default values to all of the properties I could possibly care about, both in my forms and the controls within them.
But it would be helpful to know what is causing my properties to get overwritten in the first place. I have tried to intentionally reproduce the problem, but have had no success (or failure, depending on how you look at it).
Here is a simplified example. Say I have a form that has caption "x" and a button that changes the caption to y:
Code:
Private Sub y_Click()
Me.Caption = "y"
End Sub
I've tried breakpoints and "bad exits" to try to get the y to "stick" (so that it's still there next time I open the Access file). But I can't seem to intentionally make it happen. Yet this is the exact type of thing that has occurred on several ocasions.
What could be the cause? Has anybody else encountered this?