Automate ESC key through Macro or VB code

I have a combo box that finds records. User wants to see the dropdown list as soon as entering box, no problem. Once the user determines that the record they arelooking for is not in the database they want to create it. To get to the new record form they will have to ESC to get the dropdown list to disappear and then ESC again to get the typed text to revert back to last item typed or to a blank box, otherwise I get the "not in list" error message. Is there a way to automate the ESC key instead of having to type it twice?
jerseyanneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thenelsonCommented:
Me. Undo
If that doesn't do it, try
SendKeys "{Esc}{Esc}"
0
jerseyanneAuthor Commented:
Where do I put the code, on an event or what?
0
jerseyanneAuthor Commented:
I figured out where to put the sendkeys but not the Me.Undo.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

thenelsonCommented:
The Me.Undo would go where you put the SendKeys instead of SendKeys.  It is preferable to SendKeys.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jerseyanneAuthor Commented:
That worked great, thanks.
0
thenelsonCommented:
Your welcome, why the "B" grade?
0
jerseyanneAuthor Commented:
I am not  quite sure how the grading system works quite yet.

I tried to add some additional Sendkeys commands ({DEL}{ESC}) to the same form after the first set and started getting errors. Those keys worked on the form directly so I am not sure why they didn't work in the macro.

Since I put the action for the Sendkeys in a macro, your answer on the Me.undo still didn't  help me since that, I would assume, goes into code somewhere not in the macro action.

Bottom line, it was very late at night and some of your explanations were vague so that's why I assessed the answer to be valued with a B. If there is a way to upgrade it to an A just let me know. I don't have time right now to research how to do that.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.