Intercepting error Access error messages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Geoff

    Intercepting error Access error messages

    Is it possible to intercept an error message, generated by Access, and
    replace it with your own warning. For example entering a duplicate entry
    for a key field?



    Thanks

    Geoff


  • paii, Ron

    #2
    Re: Intercepting error Access error messages

    Use the Before Update event of the control in the form to check for
    duplicate.
    Set Cancel = true, undo the edit and output a message if there is an error.
    There are example in Access help under beforeupdate.

    "Geoff" <gfriar@freenet name.co.ukwrote in message
    news:PaKdnTzR1u c84HXYRVnyuAA@b rightview.com.. .
    Is it possible to intercept an error message, generated by Access, and
    replace it with your own warning. For example entering a duplicate entry
    for a key field?
    >
    >
    >
    Thanks
    >
    Geoff
    >
    >

    Comment

    • Tom van Stiphout

      #3
      Re: Intercepting error Access error messages

      Check out the Form_OnError event.
      -Tom.

      Comment

      • Bob Bridges

        #4
        Re: Intercepting error Access error messages

        Well, you can definitely write VBA code to intercept Access errors and do
        your own thing in response to them instead of, or in addition to, whatever
        Access was going to do. So sure, you could display your own message instead
        of Access'.

        In addition -- I've never done this, but I'm pretty sure I've read about
        it -- you can register your own error numbers and error descriptions. So I
        suppose once you've done that, you can intercept Access' error and Raise
        your own. But I repeat, I've never done it so I don't know what the
        problems might be.

        ---
        Bob Bridges, rhbridg@attglob al.net, cell 336 382-7313
        (hotel) 612 869-7704 xt 118, fax 612 869-7383

        /* A crooked politician may be faithful to his wife, but a man who deceives
        his own wife can't be relied on to deal honestly with the public. We have
        been getting this backward lately. We've been assuming that you can have
        public virtue without private virtue. -Joseph Sobran, 1998 */

        --- "Geoff" <gfriar@freenet name.co.ukwrote in message
        news:PaKdnTzR1u c84HXYRVnyuAA@b rightview.com.. .
        Is it possible to intercept an error message, generated by Access, and
        replace it with your own warning. For example entering a duplicate entry
        for a key field?

        Comment

        Working...