Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba code only seems to disappear, beware the helpful windows updates 1

Status
Not open for further replies.

paboylan

Programmer
Feb 10, 2008
2
US
This story has a very happy ending, except for smacking my forehead really hard when I finally figured it out.
I thought I had lost all my vba code, I opened a form, none of the actions worked.
I went to the vba editor and seemingly it had no underlying subs or funtions, just the header info. After at least a half hour searching, checking other databases, etc... I tried to compile and little by little the compiler stopped me at places where I still had incomplete code.
Finally I looked at tools>options and saw 'default to full module view' was deselected, and realized I had a recent Windows update to thank for Bill Gates apparently thinking deselected was a desirable thing. I clicked the checkbox and now all my code reappears.

Now back to debugging why that first form wouldn't work, but at least now I can see the code that I thought was gone.
 
I am not aware of any Microsoft Update that has changed this default.
 
My money is on centrally managed third party update tool mucking with settings or a coworker messing with you. Either way, your problem is closer than you think.
 
I'm giving a star on this one, regardless of the cause, just because I had no clue that was even an option. Now I need to find someone to mess with. [wink]

This option is in the VBE for anyone like me who had never seen it. Tools -> Options -> on the Editor tab which should be the first tab you see, and near the bottom.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
strongm, it's my personal laptop at home, the only other person could have been my wife. Of course I must admit the slightest possibility that I had inadvertently changed the option myself and forgot I did it, but it manifested too soon after a "updating windows don't turn your computer off" message at shutdown, and repeat at the next startup, for me not to suspect the update caused it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top