Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Trapping 1

Status
Not open for further replies.

ottograham

Technical User
Mar 30, 2001
109
US
I get an error when a combo box field is null and my code assigns the value to a form field.

I'd like to prevent the user from seeing the error message. Can you trap the errors individually (let the other lines execute successfully without exiting the program)?

If so, please point me to where I can find the code.

Thanks
 
if it is code related

add at the top of your code in your sub

On Error resume Next



ideally though you shuold trap your errors so at the top have

On Error goto ErrTrap



and at teh bottom

ErrTrap:
select case err.number
add in lines of code to correct problem or
resume or exit sub

etc etc etc




 
if it is code related

add at the top of your code in your sub

On Error resume Next



ideally though you shuold trap your errors so at the top have

On Error goto ErrTrap

ironically i have add an error several times trying to respond to this post


and at teh bottom

ErrTrap:
select case err.number
add in lines of code to correct problem or
resume or exit sub

etc etc etc




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top