Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flex code question - Sendkeys

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,041
US
Progression 76400a.

I have a customer that wants to not allow misc vendors, so we deleted vendor *99999999999, as required. The to make sure this was never added again, we wrote some very simple Flex code on the vendor maintenance screen to test for the asterisk in the first character of the vendor number field to create a message box "misc vendors not allowed".

The next desired step is to send an escape to the screen so that the add function is aborted and focus is set back to the vendor number field, and the field would be blanked out. However I am struggling with the Sendkeys function. Here is my code:

Private Sub Name_GotFocus()
If Left(VendorNo.Text, 1) = "*" Then MsgBox ("Misc Vendors Not Allowed")
SendKeys ({Esc})
End Sub

My sendkeys function is not working at all. Can anyone shed some light on this?


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Hello Don,

Try putting double quotes " around {ESC]-----
making it SENDKEYS("[ESC]"). I have a client using SENDKEYS in a Flex application and I will check their code later today to verify this, but it's worth a try.

jerzy
 
I see I mixed up curly braces and square brackets:

should be SendKeys("{ESC}")
 
I do essentially the same thing when I add new Item Numbers and I use macform.cancel
 
Hello Don,

I wasn't able to view the actual code, but I found an old listing and I think no parentheses are needed:

that is, try SendKeys "{ESC}"

the double quotes were used.

jerzy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top