Loss of Visual Basic Code

  • Thread starter Thread starter laura
  • Start date Start date
L

laura

I have a database with many tables, forms, queries and reports that I have
been building over the past few months. Everything was working fine and then
suddenly one of my forms lost the Visual Basic code behind it - how could
that have happened? A form, but no code. The form was not based on a table
or query, it was small, just a few text boxes and labels and a list box
which was populated with a SELECT statement. Any ideas? Could I have a
corruption somewhere?

Laura TD
 
One possibility is if the form's Has Module property was changed to No. That
will delete the code module behind a form. Otherwise, corruption is a
possibility. Assuming someone didn't delete the code itself.

Time to replace the form from the backup copy of the database.
 
No, in all the backups I have where the form actually had lost it's VB Code,
the "Has Module" was set to yes. Really strange and yes, thank goodness I
did have a backup - several in fact going back through many stages of
development as I had been backing it up with the 'corrupt' form before
realising the problem. I wonder what could have caused it. I have Windows XP
with Office 2000 and SP-3.

Laura TD
 
Many strange corruptions can occur during development as you constantly
open/close objects, modify/compile/run code, etc. Good developers make
backups often and keep them for long periods of time during the development,
just for situations such as yours.
 
Back
Top