Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 21st, 2004, 06:09 AM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 319 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 18 h 11 m
Reputation Power: 11
Talking error handling

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.
__________________
Damo
Have you Kissed the Bride lately?

Reply With Quote
  #2  
Old January 21st, 2004, 01:26 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
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-

Reply With Quote
  #3  
Old January 22nd, 2004, 10:26 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
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

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > error handling


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway