Solved

Invalid Character Msg when using SendKeys

Posted on 2002-05-03
4
316 Views
Last Modified: 2006-11-17
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
Comment
Question by:Winnebago
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

Expert Comment

by:James Elliott
ID: 6988784
Try using

sendkeys "{ESC}" ,true

Thanks

Jell
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6989443
Why don't you try setting focus to next control?
0
 
LVL 5

Accepted Solution

by:
gwgaw earned 50 total points
ID: 6989458
Or try this...

Private Sub MyControl_NotInList(NewData As String, Response As Integer)
Response = acDataErrDisplay
MyControl.Undo
End Sub
0
 

Author Comment

by:Winnebago
ID: 6998899
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question