Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003

    Unanswered: VBA works in debugging mode, not otherwise

    Has anyone else had this problem? It's happened to me several times now and I don't get it. I'm using Access 97.

    I run some code and it doesn't work - either I get an undebuggable error, or it exits and nothing happens, or something. So I debug it step by step and it works. Obviously this is extremely annoying because I don't know where the problem is, and as far as I'm concerned there is no problem. But if I run it normally, there's a problem.

    I can post the code if required but the problem doesn't appear to be code-specific. I was rather hoping someone might have an answer to the effect that "oh yes Access does this really annoying thing where...".


  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    bad news - no, it's not normal, it's you.

    assuming this is .MDB, start it with your thumb on the Shift key - keep that thumb hard down until the mother-Gates message has been OKed and the app is fully open.

    ...your code window opens

    Code Window menu: Debug/Compile
    ...any issues?

    Code Window menu: Tools/Options/General -- select Break on All Errors your app. does it stop on an error line?

    Code Window menu: Edit/Find -- select Current Project, look for the word 'quit' -- Find Next
    add a break point on each occurance of quit your app. does it stop on a quit line - if yes backtrack from that line.

    that's all i can offer from the minimalist data you have provided. you must admit that and nothing happens is somewhere short of a full description of the problem given that we have no idea what is supposed to happen. (i have many .MDE where 'nothing happens' intentionally - run them and you are thrown out immediately (these are my backend data files))

    currently using SS 2008R2

  3. #3
    Join Date
    Feb 2004
    One Flump in One Place
    I've had this happen when I have an asyncronous process running. The act of debugging allows the process to complete because the code is executed more slowly so no errors are viewed when debugging because the process of debugging prevents them occuring . Similarly if you have something running on the timer that your procedure is dependant on....

    Just some straws for you to clutch onto.
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Apr 2003
    Thanks so much for your answers.

    I worked out the location of the problem by putting a msgbox progressively further down my code to see if it came up or not. I was quite pleased with that. And yes it was an exit that was the issue. But the reason it was OK stepping through but not running normally was that the code picked up the value of a subtotal from a subform - when running normally it hadn't loaded in time, so the value was null. When I stepped through it had time to load so the value was picked up.

    So there you go.

    Thanks again x

Posting Permissions

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