35 pts.
 Link RDP in Microsoft Access to click computer name to remote control
I have build a Microsoft Access 2007 database for trouble tickets and inventory. 

I have a table called INVENTORY.  One fo the fields is DEVICE NAME.  Right now it is simpy a text field.  In this field we enter the comptuer name (example COMPUTER1234)

We have forms which contain the DEVICE NAME field.  I would like to be able to to click the field or a button that will launch and RDP session and connect to the computer name specified for that specific record.

Any help would be greatly appreciated.

ASKED: Feb 10, 2012  2:48 PM GMT
UPDATED: February 27, 2012  8:54:53 PM GMT
1,120 pts.

Answer Wiki:
The one problem I see, just like creating a shortcut on your desktop, is that unless you already make a connection to the remote system, the space in the RDP will either remain blank or will have the name of the last session. If you try to experiment this from your desktop, you will see what I mean. So setting up an automatic RDP session to one computer after another without typing it in is somewhat problematic, you need to create a script where the RDP program is first brought up then the computer name is inserted. Once this script is done, then you should have no problem, but that is the order in which you have to work in. I see no other way around it and I do a lot of RDP work and that is one of the problems I always run into.

Hope this at least points you into the right direction, but sorry I could not give you a straight out answer.
Last Wiki Answer Submitted:  Feb 13, 2012  7:24 PM (GMT)  by  Harisheldon1960   1,120 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _




 

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
 305 pts.

 

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!

 35 pts.

 

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

 1,215 pts.

 

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?

 35 pts.

 

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.

 305 pts.

 

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

 305 pts.

 

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!

 35 pts.