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

Posted on 2008-11-12
Last Modified: 2013-11-27

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?
Question by:TicketMan
    LVL 15

    Expert Comment

    by:Haris Djulic
    where did you wrote your code with enum?
    Because Enum statement can be only in module

    Author Comment

    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.

    LVL 84

    Accepted Solution

    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.

    Author Closing Comment

    Thank you very much for your help! Excellent.

    Author Comment


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

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now