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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Handling

Status
Not open for further replies.

acnovice

Programmer
Jan 27, 2005
100
US
Hi,

I want to put my own error msg to my combo box. I have a combo box and set the Limit to List "Yes". When a user put the product type which is not from list, it gives an error message. I gave the error msg to "On Not In List" under event procedure but still I'm getting automatic error msg from system. I want to remove this system generated error msg.
I attached my error generation code and it is very simple.

Code:
Private Sub ProducType_NotInList(NewData As String, Response As Integer)

On Error GoTo Error_Handler

Error_Handler:
    MsgBox "List not found."
    
End Sub
Appreciat your help.
 
In the VBA help file have a look at the Response parameter of this event procedure.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I'm not 100% sure, but I believe the NotInList event will not fire if LimitToList = True.

If you want to show your own custom message if user tries to enter something not in the list, I think you need to set LimitToList = False, then handle this situation in the NotInList event. You would then set the Response parameter to whatever enumeration value indicates you have handled the error yourself (I don't remember what the enumeration constants are off the top of my head, but should be easily found in VBA Help).
 
I got back to work.

JoeAtWork,

I set the response parameter and it works fine and Yes... the access error message popping up's gone.
Thank you.

ZmrAbdulla,
Thank you for the code... it works good.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top