+ Reply to Thread
Results 1 to 5 of 5

Error not being handled, instead pops up error prompt

  1. #1
    Registered User
    Join Date
    07-01-2024
    Location
    USA
    MS-Off Ver
    Office 365 build 2404
    Posts
    3

    Question Error not being handled, instead pops up error prompt

    I am tying to raise an error under an error handler to allow for a DB transaction to be rolled back when an attempt to create duplicate model in the database happens. However, the error handler does not handle this error and instead shows me the error prompt. Please advise.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,090

    Re: Error not being handled, instead pops up error prompt

    Which line is generating the error?
    I tend to only begin a transaction before any changes are attempted with an additional boolean flag. Then in the error handler you use the flag to determine whether anything needs rolling back.

  3. #3
    Registered User
    Join Date
    07-01-2024
    Location
    USA
    MS-Off Ver
    Office 365 build 2404
    Posts
    3

    Re: Error not being handled, instead pops up error prompt

    Please Login or Register  to view this content.
    This is essentially right after I start the transaction.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,013

    Re: Error not being handled, instead pops up error prompt

    Do you have your VBE options set to break on all errors?
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,090

    Re: Error not being handled, instead pops up error prompt

    So if you step through, does it jump to the error handler at that line?
    You could try leaving out the source parameter e.g.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Error pops up in the code if sheet name is digits
    By pm.patel189 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2018, 11:45 AM
  2. Error msg pops out when a button is clicked more than once
    By jlyh11 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-22-2015, 03:18 AM
  3. Prevent Loss of Data -- Error Message Pops Up
    By brit1sh in forum Excel General
    Replies: 3
    Last Post: 09-11-2013, 01:30 PM
  4. Error pops up on line On Error Resume Next
    By Erusso in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2012, 04:57 PM
  5. error message pops up
    By louise2613 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-21-2012, 12:36 PM
  6. Macro error that pops up all the time
    By jmedick in forum Excel General
    Replies: 2
    Last Post: 09-24-2007, 11:40 PM
  7. Error-the message 'Device I/O error' pops up.
    By lehainam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2006, 01:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1