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

AppActivate in MS-Access 2000/Windows XP

Status
Not open for further replies.

afryer

Programmer
Joined
Mar 9, 2004
Messages
207
Location
GB
Hi all,

I hope someone can help me with an annoying problem I am having when developing an application in access.

Basically, what I am doing as part of my application is opening a DOS telnet session using the shell command. I need then to use the SendKeys event to log into the telnet session automatically, i.e send the user name and password and then perform some maintenance on the remote box. My code is as follows:

Code:
dim l_return
l_return = shell ("telnet", 1)
AppActivate l_return
SendKeys ("my user")

The problem is occurring in the AppActivate command, bringing up an error message of 'Invalid Procedure Call or argument'. Is there some difference between Access 2000 in which AppActivate seems to work and Access 2002?

If I remove the AppActivate command the code opens 26 telnet sessions for some reason :-)

Any help would be appreciated.

Andrew
 
Code works on my machine.

Did you try it with the full path to the telnet.exe file?

Try this...

Public Sub TelIt()
On Error Resume Next
Dim l_return
l_return = Shell("telnet", 1)
AppActivate l_return
SendKeys ("my user")

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top