
Here is a vba example that seems to work on my local client:
Private Sub cmdRunApp_Click()
On Error GoTo Err_cmdRunApp_Click
SomeControl.SetFocus
Call Shell(”mstsc.exe /v ” & SomeControl.Text)
Exit_cmdRunApp_Click:
Exit Sub
Err_cmdRunApp_Click:
MsgBox Err.Description
Resume Exit_cmdRunApp_Click
End Sub

Ok, I tried but failed.
On SomeControl.SetFocus I’m thinking this is the field in the form, correct?
Not sure about the Somecontrol.Text
Would like to discuss further, as obviously I’m just not a coder!
Thanks!

Yes. Mgi has the correct idea. Here I just cut the code down for a click of a defined button called Command6. me.field references the current form and field is called field2
Private Sub Command6_Click()
Shell (”mstsc.exe /v:” & Me.Field 2)
End Sub

Orangehat (and Mgi if you are still watching),
Thanks for the reply. I really do appreciate you taking the time to help me out.
I must be slow. Here is what I have and what I did.
My form is named - Inventory
The field is the table is named - Device_Name
Here is what I did (I named my button RDP)
Private Sub RDP_Click() Shell (”mstsc.exe /v:” & Inventory.Device Name) End Sub
When I run the code I get a Complie Error: Syntax Error.
It highlights the Shell (”mstsc.exe /v:” & Inventory.Device Name) line.
When I click in the line it highlights Name and gives the following:
Compile error: Expected: list separator or ).
What am I doing wrong?

you seem to have a colon rather than a space after the ‘v’?? v is just a command line switch indicating that what follows after the space will be the host name.

Thanks OrangeHat; Sometimes I get too busy to follow up promptly.

OK, I could not have done this at all without you guys!
However, I figured out what was wrong.
Here is what my final code looks like:
Private Sub RDP_Click() Shell (”mstsc.exe /v:” & Device_Name) End Sub
It seems I didn’t need to specify the form since I was already on it, and just needed to specifiy the field.
Also, the V: does need the colon, as if you do a help on mstsc you’ll note some qualifiers use colons and others don’t.
However, you guys are great and I could not have figured this out without your guidance. Thank you so much! I really appreciate it!












