• Code Stops Working (A2K sr1)

    Author
    Topic
    #378467

    For no reason that I can see my acces db code has stopped working. I have menu form with buttons and after about 2 pushes I get a pop up saying

    Run time error 2486
    You can’t carry out that action at this time.

    Then none of the buttons work (I get the same pop up each time or a longer explanation saying the same thing) and all I can do is close the db and reopen. But soon the same thing happens.

    I’ve tried going back thru backups but eventually the same thing happens. It seems to stop recognising code. I just can’t fathom it and I’d hate to have to set up the whole thing from scatch again.
    Any thoughts?
    Peter

    Viewing 0 reply threads
    Author
    Replies
    • #626541

      Try setting a breakpoint on the code and step thru it using the F8 key, and you should soon see which piece of code does not work.
      Pat smile

      • #626708

        Thanks patt
        I’d checked that and the offending line where it stopped was perfectly OK on the face of it. I’ve overcome the problem by rewriting the 2 bits of code that set off the problem and all seems fine now – but I’m intrigued as to what set it off in the forst place. It may happen again.
        Peter

        • #651729

          Any idea what caused this? I’m having the same problem and the code breaks on a line that is perfectly fine also… docmd.maximize… so I am at a loss. Any help would be appreciated…..

          • #651769

            What error do you get?
            Pat cheers

          • #651792

            Eileen
            I can’t remember exactly, but I think it was one piece of code. So even when I restored a backup it misfired every time I ran that piece of code. I never found out why but I think I scrapped the one piece of suspect code, wrote it again from scratch and everything worked OK
            Good luck
            Peter

          • #651798

            I’ve noticed that Access will occasionally get confused about what is causing an error and stop on an apparently innocuous instruction instead of identifying the real problem. The irritating thing is that when that happens, code that should trigger a syntax error (like having an Exit Function in a Sub routine) may not do so. When I see that kind of behavior, I start carefully checking each routine that is called and pay close attention to the error handling. I’ve never found an quick and easy way to identify those pesky errors, and it is sometimes easier to just rebuild the code if there isn’t too much of it.

    Viewing 0 reply threads
    Reply To: Code Stops Working (A2K sr1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: