View Full Version : Suppress error message for combo box


itchy
07-24-2001, 07:52 AM
Hi,
I am trying to suppress the default error message that is generated when the user enters an item that is not on the list. I would like, instead, to have my own error message that is a little more descriptive. I have tried adding a message box to the 'On Not on List' event of the combo box but this just diplays my message box first and them still displays the default error message. I tried the 'doCmd.setWarnings False' statement in a number of places, including the beforUpdate, onChange events of the combo box and even tried it in the onLoad event for the form but it still displays the message. Does anyone know another way that I can suppress this message?
Thanks,
Itchy

charityg
07-24-2001, 08:04 AM
After the msgbox "blah blah"

use

Response = acDataErrContinue
cboName.Undo

The first line suppresses the error message and the second line will undo the change that produced the event.

~Charity

itchy
07-24-2001, 09:15 AM
Beautiful!

Thanks!