Link to home
Start Free TrialLog in
Avatar of Winnebago
Winnebago

asked on

Invalid Character Msg when using SendKeys

I am using a drop downlist where the user enters a birthdate.  If the birthdate is not in the list, I would like to use sendkeys "{esc}" in the not in list event.  I am getting the message "invalid character".  Could anyone let me know what I am doing wrong?  Thanks
Avatar of James Elliott
James Elliott
Flag of United Kingdom of Great Britain and Northern Ireland image

Try using

sendkeys "{ESC}" ,true

Thanks

Jell
Avatar of Richie_Simonetti
Why don't you try setting focus to next control?
ASKER CERTIFIED SOLUTION
Avatar of gwgaw
gwgaw

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Winnebago
Winnebago

ASKER

I couldn't get the other solutions to work, so I did something similar to your solution:

If MsgBox("No matches were found for the date you entered.", vbOKOnly) = vbOK Then
            Response = acDataErrContinue
        ctl.Undo
End If

Thanks for your help.