OK, so I'm at a bit of a loss here.
I've got an Access database and form with all the company's computers on it. What I wanna do is get my button to launch RealVNC to connect to the HostName specified in a control on my form.
I've tried the following:
But all that happens is Access launches RealVNC but says Invalid procedure call or arguement. I have a feeling SendKeys isn't working, as when I paste, the HostName is not pasted.
I can't use DDE as my control is bound to a column in my database.
Can someone help please!
I've got an Access database and form with all the company's computers on it. What I wanna do is get my button to launch RealVNC to connect to the HostName specified in a control on my form.
I've tried the following:
Code:
Private Sub btnVNC_Click()
On Error GoTo Err_btnVNC_Click
'Copy the computer's HostName
txtComp.SetFocus
SendKeys "^{C}", True
'Run VNC Viewer
Dim stAppName As String
stAppName = "C:\Program Files\RealVNC\VNC4\vncviewer.exe"
Call Shell(stAppName, 1)
'Paste the computer's HostName and press enter.
AppActivate (Shell(stAppName, vbNormalFocus))
SendKeys "^{V}", True
SendKeys "{ENTER}", True
Exit_btnVNC_Click:
Exit Sub
Err_btnVNC_Click:
MsgBox Err.Description
Resume Exit_btnVNC_Click
End Sub
I can't use DDE as my control is bound to a column in my database.
Can someone help please!