Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access error messages (2003)

    Hi there,

    I'm sure I've asked this one before, but can't trace it! The problem relates to error trapping, but not the errors that are thrown up with an error number. What I would like to do is intercept the message boxes which Access throws up when say appending record to a table and Access says something like "was unable to insert 2 records due to data violations, 0 records due to key violations etc. Press ok to continue or cancel to halt."

    Is there a way to do this? It would enable me to present a more user friendly feel to the users such as can be done by interpreting the normal error message codes.

    Cheers,

    Niven

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

    Re: Access error messages (2003)

    If you're adding a record manually or through a query, you cannot trap error messages.
    If you do it through a form, you can use the Form_Error event to handle general errors.
    See <post:=667,850>post 667,850</post:> and the thread starting at <post:=451,828>post 451,828</post:> for examples. The latter thread also explains how to find the relevant error numbers.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access error messages (2003)

    Hi Hans,

    I'm appending data from an import table to a main table via a query, so will have to insist the users are a bit more vigilant with cleansing the data prior to import.

    Cheers,

    Niven

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access error messages (2003)

    Niven

    One way around this might be to have a separate temporary import table where all fields are defined as Text 255, Required=No, Indexed=No. This table would have no indexes, and would be cleared down prior to each import.

    You would then be able to check this table for possible data errors after running the append query and before moving the data to the main table. This should avoid most errors.

    Nick

Posting Permissions

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