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

How do I suppress the default NotInList message box

Status
Not open for further replies.

rpochoda

Technical User
Dec 5, 2004
34
US
I've written an procedure to run on the NotInList event of a combo box which starts by displaying a custom message box asking the user whether he wants to add to the list, etc. But I don't seem to be able to suppress the default NotInList message box. It pops up behind my custom one. I tried using "DoCmd.SetWarning False" on the control's GotFocus event and then also on the NotInList event. Neither worked, and actually from the inadequate documentation, it seems that if it had, it might suppress my custom message box as well.

I suspect I'm missing something real simple. So, how do you do it?

Thanks.
 
Hello:

You need to use the setwarnings method in your procedure.

When the below code is run, it will suppress the message your inquiring about until you reset it back on!

DoCmd.SetWarnings False

Regards
Mark

 
In the NotInList event procedure, you have to use the following if the NewData has been created:
Response = acDataErrAdded

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks folks for responding so quickly.

As I said in my post, I tried using the SetWarning method and it didn't work. "Response=acDatatErrAdded" works, but turns out not to be what what I want to do.

I googled "acDataErrAdded" and found a nice little article "NotInList Event Demystified" at
For my purposes, "response=acDataErrContinue" is better because I don't want to let the user enter the new data right away, but rather want to take him to a different form where he has to respond to a bunch of fields containing data about what will become the new combo box list entry.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top