• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 537
  • Last Modified:

Why does Ms-Access 2003 Visual Basic Editor stop responding when I type 'Enum' in vba-code?


I am writing a visual basic application using ms-access 2003 and vba, and have this problem:
Whenever I write 'Enum' in the visual basic editor code, ms-access freezes completely and stops responding. The only thing that shows is a complete white window with in the title bar 'Not Responding'. I cannot even close Ms-Access, so I have to terminate the process using Windows Task Manager. Does anybody know why and have a fix?
  • 3
1 Solution
Haris DjulicCommented:
where did you wrote your code with enum?
Because Enum statement can be only in module
TicketManAuthor Commented:
I wrote a simple Enum statement under 'Modules' in MS-Access:
Enum CompanyColors ...and on pressing enter to go to the following line of this statement everything freezes.
I just tried to write it within a public function under Modules (just to test) and now I am getting the same problem after hitting [Enter] behind: Public Function SwitchBackColors(strFormName as string) as Integer. So it seems not only to do with Enum...
In contrast when I just type Dim CompanyDefaultColor as Integer in a Module all is fine, nothing freezes.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Sounds to me like corruption. If I were you I'd immediately make a backup copy of the database, then try this:

1) Compact and Repair (Tools - Database Utilites)
2) Decompile - build a desktop shortcut with this as the Target: "full path to msaccess.exe" "full path to your db" /decompile
3) Import all into a new, blank database

If those don't work, you may have to work from a backup, or have a recovery service try and save your project.
TicketManAuthor Commented:
Thank you very much for your help! Excellent.
TicketManAuthor Commented:

Thank you! You are right, it was corrupt. Decompiling as you mentioned solved it nicely.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now