Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    110

    Unanswered: Capturing asynchronous errors

    Hello everybody

    I have this small problem. Is there any way I can capture an asynchronous error, where by asynchronous I mean every error that occurs outside of VBA code written by me.
    For example, I have a form with a text box on it. I have informed Access that the text box has a date format. Sometimes a user may input a date incorrectly, and Access will display a rather daunting error message. How can I capture this error so I can display a more user-friendly error message.

    George Papadopoulos
    Electronic Engineer
    Attached Thumbnails Attached Thumbnails green_ant.gif  

  2. #2
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    would it not be easier to add validation to the text box, using the Before_Update event of the textbox? This way you can test the date, and then cancel the update event if required

  3. #3
    Join Date
    Apr 2004
    Posts
    110
    Exactly! I was not aware of the details of implementing the validation of the date in the text field, when I posted. I think it has something to do with the Cancel MS Access internal variable.

    e.t.c.

    If Not IsDate(Me.txtDate) Then
    Cancel = True
    MsgBox("Error")
    End If

    Is that correct?

  4. #4
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    yea, that should do it, have you tried it?

  5. #5
    Join Date
    Apr 2004
    Posts
    110
    It did! thx, for your help!

Posting Permissions

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