|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
G'day all
to make my database more user friendly when queries are run, how do i handle incorrect user parameter inputs without having to learn a heap of code. Will a macro handle errors?? I appreciate any advice. ![]() |
|
#2
|
|||
|
|||
|
I have attached a sample DB with Error catching built in.
Look the beginning to the code for one of the update buttons on the frmCustomers You will see a on Error statements. The look at the end of the sub add you will see code that captures that error If you have any questions ask away S- |
|
#3
|
|||
|
|||
|
I have added example to this error handler that will hopefully help you in know how to use it.
S- Private Sub .............Name 'If an error occurs goto my ADO ErrHandler On Error GoTo ADOErrhandler Code... ... ... ... ...Code 'What do I do with the err ADOErrhandler: 'Determine what to do with specific errs Select Case Err.Number Case = 13 'Data Type MisMatch Error (I think) 'Add code on what to do when you encounter this error msgbox "Phone Number can't include letters of alphabet" exit sub Case = 80 ' Invlid us of Null Value (I think) 'Add Code (I'm will tell system to just continue on its way and ignore the error Resume Next ' New error that we aren't aware of will be captured and generate us a message Case Else MsgBox Err.Number & vbCrLf & Err.Description End Select ENd Sub |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > error handling |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|