Solved

Invalid Character Msg when using SendKeys

Posted on 2002-05-03
4
305 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
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

830 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