• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

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
0
Winnebago
Asked:
Winnebago
1 Solution
 
James ElliottManaging DirectorCommented:
Try using

sendkeys "{ESC}" ,true

Thanks

Jell
0
 
Richie_SimonettiIT OperationsCommented:
Why don't you try setting focus to next control?
0
 
gwgawCommented:
Or try this...

Private Sub MyControl_NotInList(NewData As String, Response As Integer)
Response = acDataErrDisplay
MyControl.Undo
End Sub
0
 
WinnebagoAuthor Commented:
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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now