Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: Error trapping when inserting new record in datasheet view?

    HI. I've got a split form where the user can insert new data directly in the datasheet half.

    If the user tries to insert a record with some values missing, at the moment it gives ODBC errors.

    All Im trying to do is catch these errors so I can messagebox, but i've tried the before update and before insert events but they don't work.

    the on error event traps it but the errror number is 0, and the ODBC error still shows up afterwards.

    Is there a way I can trap the ODBC error when inserting a record into a datasheet?

  2. #2
    Join Date
    May 2004
    New York State
    Instead of typing directly into the datasheet, try letting the user type into unbound text boxes. Make a "Confirm Data" command box to allow the user to signal that he's finished, and then start testing the data control by control. If you detect an error, you can then use messagebox. Don't submit the data to the datasheet until all errors are fixed.

Posting Permissions

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