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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use sendkeys to activate an App, and send values from field 1

Status
Not open for further replies.

jahlmer

Technical User
Aug 23, 2000
143
US
This might be very very simple (hopefully).

I have an application named Vantive. I need to use the sendkeys command to input the value of the Event # field from the frmNewCalls form.

Here's what I've got:

Private Sub cmdSendEventToVantive_Click()

Dim Vantive

AppActivate "GCS Event Tracking"

SendKeys "{F10}" + "{DOWN}" + "{RIGHT}" + "{DOWN}" + "{ENTER}" + "{TAB, 2}" + "{=[Forms]![frmNewCalls]![Event #]}", True

End Sub


Now, you see the "{=[Forms]![frmNewCalls]![Event #]}" bit... that doesn't work...

Do you know what would work?

Help will be appreciated!
 
Oops... remove the comma from {TAB, 2} .. that shouldn't be there.
 
Jahlmer,

I ended up using sendkeys to select and copy a web page. They really act the same as typing on the keyboard, so what you have could at best type {=[Forms]![frmNewCalls]![Event #] into the cell you reach. I assume it's the value of
Code:
[Event#]
you want input.

In Vantive, see how you would go about pasting the value into the appropriate cell.


HTH John

Use what you have,
Learn what you can,
Create what you need.
 
Hey John,

Thanks for the suggestion. Here's what I came up with. I'm using it left and right, and can finally acheive the once though impossible tasks!!


Private Sub cmdFindEvent_Click()
Dim MyVar1
MyVar1 = [Forms]![frmNewCalls]![Serial #]
[Serial #].SetFocus

If IsNull(MyVar1) Then
MsgBox "You have not entered a Serial Number Yet!"
Else
SendKeys "^{c}", True
AppActivate "GCS Event Tracking" ' Activate Vantive
SendKeys "%{f}" & "{DOWN}" & "{RIGHT}" & "{DOWN 3}" & "{ENTER}", True
SendKeys "{TAB 12}", True
SendKeys "+{HOME}" & "{DELETE}", True
SendKeys "^{v}" & "{ENTER}", True
SendKeys "{ENTER}", True
End If
End Sub

Thanks again... And here's a star!
 
Glad it worked out! And thanks!
John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top