Link RDP in Microsoft Access to click computer name to remote control

35 pts.
Tags:
Microsoft Access 2007
Microsoft Access fields
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • mgj
    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
    
    320 pointsBadges:
    report
  • Maxwellafb
    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 pointsBadges:
    report
  • orangehat
    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,745 pointsBadges:
    report
  • Maxwellafb
    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 pointsBadges:
    report
  • mgj
    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.
    320 pointsBadges:
    report
  • mgj
    Thanks OrangeHat; Sometimes I get too busy to follow up promptly.
    320 pointsBadges:
    report
  • Maxwellafb
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following