Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Debug in Access 2002 VBA (Access 2002)

    I am new to the 2002 environment and don't know if something is just not set right or I am just not using the new version correctly. The problem I am encountering is that when I try to debug my code it will do any and all of the following:

    1. If I set a breakpoint and run the form, it runs right past the break and never stops. I have even added something as simple as a msgbox for it to stop on and it just runs the box and never stops.
    2. If I goto Run Sub/User Form then it brings up a Macros box. I do not want to run a macro.
    3. If I hit Debug and do a step into it just beeps at me.

    I did not install the software on either of the two machines I am trying this on but I get the same result on both. I feel like I am either crazy or doing something very stupid. I never encountered a problem in 97. Any suggestions???
    Thanks

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Debug in Access 2002 VBA (Access 2002)

    VBA is quite different from Access Basic in 97 - and the development environment is quite different. But you should be able to get a breakpoint to function. I presume you are working with a class module associated with a form from your comment. One thing you might try is forcing a debug situation where you deliberately try to reference a control that isn't there and see if that give you the ability to debug. Otherwise it may be that the installation has somehow been clobbered.
    Wendell

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Debug in Access 2002 VBA (Access 2002)

    It may depend where your breakpoint is set. As you noticed, you can't use a Step Into (F8) or Run Sub (F5) in a sub in an Access form module. I'd recommend set breakpoint at first executable statement in sub. For example, if you have an error handler, and first line after sub declaration is something like On Error GoTo Err_Handler, set breakpoint there. Or use form's On Open event, set breakpoint on first statement, for example, DoCmd.Maximize. Open form, execution should halt immediately at the breakpoint. You can then use F8 to step thru code, or F5 to continue running code. Or, as Wendell suggested, add a deliberate error, such as a reference to a non-existent object, and see if execution breaks on error (turn off error handling temporarily). If neither of these suggestions work, then something may indeed be "clobbered" as Wendell would say.

    HTH

  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Debug in Access 2002 VBA (Access 2002)

    PS: In case this was never resolved, one additional note applicable to Access, it may be not be obvious but also check the database Startup options (Tools menu). If "Use Access Special Keys" option not checked, code execution will NOT pause on a breakpoint, in form module or elsewhere. This option affects Show Database Window, Show VB Window as well as "Pause Execution", applicable to breakpoints. In earlier versions of Access you have to click Startup dialog "Advanced>>" button for Use Access Special Keys option to be displayed.

    HTH

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Debug in Access 2002 VBA (Access 2002)

    Access 97 used VBA. Access 2.0 was the last version that used AccessBasic. The difference between 97 and 2000/2002 isn't in VBA, it's only in the VB Editor.
    Charlotte

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Debug in Access 2002 VBA (Access 2002)

    You're right - it's been too long since I've worked in Access 97 to any extent.
    Wendell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •