We help IT Professionals succeed at work.

How do I reload a combo box after NotInList Event fires?

235 Views
Last Modified: 2015-06-11
When the NotInList event fires, I use the NewData and DAO's SEEK command to see if the NewData exists in a table. If so, I want to suppress error messages from ACCESS, and I want to requery the combo box and have NEWDATA displayed in the dropdown list.  

The query which supplies  the fields in the drop down list  is based on the contents of a text box ("CustShortName"). When the SEEK is successful, I store in the text box the value which should cause the requery to be successful. I'm missing something, because the combo boxes drop down list is empty and I get the standard ACCESS error about the string not being in the list.
I
After SEEKing NEWDATA and putting the correct data in "CustShortName", I set Response = acDataErrAdded and exit the NotInList event.  Help, anyone?

Steve
Comment
Watch Question

John TsioumprisSoftware & Systems Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Somewhere you must have something wrong because i also use Response = acDataErrAdded and it works fine without requery
President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
SowleManRetired

Author

Commented:
Thank you, Jim. Your experience paid off for me. I was reminded that the binding field can be different than the displayed field(s). I'm off and running!!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.