Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2008
    Location
    Brisbane, Australia
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Broken VBA (Access 2002 SP#)

    I have a moderately complex application which until to-day has had no problem I have been unable to deal with. Suddenly I start getting errors about object variable not set. I discover that the statement
    On Err Resume Next
    is being ignored.

    I know this is lazy programming, and I can undoubtedly, with some effort, find out where the recordset I was trying to close had already been closed, but I would like to know why. I have uninstalled Access and re-installed it, without success. I will undoubtedly upgrade to a later Access eventually, but my experience of this has always been messy and I don't look forward to it.

    The application works fine on the two sites I support. It is only at home that it has started to misbehave.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Broken VBA (Access 2002 SP#)

    It should probably be "on error" not "on err".
    Have you checked for any MISSING references?

  3. #3
    New Lounger
    Join Date
    Sep 2008
    Location
    Brisbane, Australia
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Broken VBA (Access 2002 SP#)

    you are right! It IS "on error"! I'm mixing my languages.

    Yes, I checked first up for missing references. Nothing is shown as missing, although I am aware that new applications can load a different version of something, but I am not aware of any new applications.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Broken VBA (Access 2002 SP#)

    In the Visual Basic Editor, select Tools | Options...
    Activate the General tab.
    In the 'Error Trapping' section, make sure that 'Break on Unhandled Errors' is selected. (If 'Break on All Errors' is selected, error handling is ignored)

  5. #5
    New Lounger
    Join Date
    Sep 2008
    Location
    Brisbane, Australia
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Broken VBA (Access 2002 SP#)

    HansV

    Your blood is worth bottling! It would be interesting to know how you first discovered this little fact.

    Thank you so much! Problem solved.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Broken VBA (Access 2002 SP#)

    The problem has come up in Woody's Lounge before, so when you reported that On Error Resume Next was ignored, it rang a bell.
    I'm glad the problem has been solved.

Posting Permissions

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