Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Corruption...
Donald Blackwell 
       
8 months ago
So working a project and something weird happened...

I went to delete a button off a form and Access froze up then rebooted. When I re-opened the file, went into the form to delete the button, it said I couldn't delete that control. Tried compact/repair to no avail. Went to the VBE and tried debug compile and it said all my VBA was invalid.

So I rebooted Windows and tried again. Still couldn't delete the button and if I opening the form and clicking anywhere it said I had called a sub or function that didn't exist. Went back to the VBE and everything was there. So, I pulled out the handy Troubleshooter and started working that.

Reloaded the project again, and a message that the VBA code was incompatible and that Access needed to delete it and restart. I said no but it did it anyway.

Rebooted and all the forms were "good". I was able to delete the button I was trying to get rid of, but ALL of the VBA Form and global modules were gone. UGH.
Richard Rost  @Reply  
          
8 months ago
Holy crap, yeah, that's definitely a weird one. I've seen that kind of thing happen before, but it's extremely rare. That's exactly why I'm always preaching good backups. And I also make a quick backup copy of the ACCDB front-end file any time I know I'm going to be making major changes.

Any time I see one of my databases start acting strange or doing something it shouldn't, I reboot right away. Any kind of flaky Windows memory glitch can cause all sorts of corruption. So my rule is simple: the second Access starts behaving oddly, I shut it down and reboot before touching anything else.
Donald Blackwell OP  @Reply  
       
8 months ago
Luckily, I DO have the backup from when I stopped last night. I was able to import the global modules from there and just had to copy paste the VBA from the Form modules (it wouldn't let me import the modules that the name starts with "Form" do to conflicts.).

After that, it STILL wouldn't work. It kept giving me "Unknown user-defined type" errors. When I look to see what it was pointing at it was "Dim rs as Recordset".

Somehow, it managed to clear the reference to the Microsoft Office Access 16 database engine library. Re-checked that, and now I just have to rebuild the code from this morning.
Richard Rost  @Reply  
          
8 months ago
You might want to be careful with that database. I would start with a blank new database file, create a blank ACCDB, and just re-import all your objects. Your file could be corrupted.
Donald Blackwell OP  @Reply  
       
8 months ago
Richard Yeah, that's what I was thinking. even if it's not, better to do it now when it only has a little sample data and helper data than down the road and lose valuable data.
Kevin Yip  @Reply  
     
8 months ago
Sometimes, there may be only partial corruption in the database, or only a single control is corrupted.  If you can isolate the component, you may only need to fix that control only instead of the whole database.  The video shows how I fixed an apparently corrupt textbox that is always blank:

https://youtu.be/-LE4XBBSO1M?si=xvpbaXpc-WQrohch
Donald Blackwell OP  @Reply  
       
8 months ago
Well, I tried copying into a blank db. All the tables and queries copied w/ no problem. But most of the forms wouldn't even copy to the new accdb.
Kevin Yip  @Reply  
     
8 months ago
Donald  Did you import or copy/paste?  To import, you need to go to External Data -> New Data Source -> From Database -> Access, then follow the wizard.  Copy/paste, I gather, is when have two .accdb files opened side by side, you right-click on an item, click Copy, then go to the other database, right-click, click Paste.  If you've only tried one method, try the other.
Donald Blackwell OP  @Reply  
       
8 months ago
I did both... I did the drag/drop of objects from one db to the other. Then I tried import via the menu. I'm at the stage where I'm probably just gonna start with blank and copy paste the controls over 1 form at a time into a new form and then have to do the vba as well.
Richard Rost  @Reply  
          
8 months ago
Can you save the forms as text files from the original database? You could recreate them that way.

I know you say you ran down the troubleshooter, but did you try decompiling?
Donald Blackwell OP  @Reply  
       
8 months ago
Yeah, when I decompiled, that's when it erased the vba
Kevin Yip  @Reply  
     
8 months ago
There is a way to create forms (and tables, queries, reports, etc.) from scratch entirely via VBA code.  I believe Richard has touched on this, but I don't know if he has a full course.  This would help you greatly in a situation like this when you need to start fresh: you just run the VBA code and your forms are back.  If I had lots of Access users in my charge, I would definitely consider all-code designs.
Richard Rost  @Reply  
          
8 months ago
Donald Blackwell OP  @Reply  
       
8 months ago
Yeah, had that pegged to re-watch :)

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 6:40:23 PM. PLT: 2s