Results 1 to 5 of 5
  1. #1
    enragedcow is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    3

    Question Read form info, pass to VB script... lost

    Hi All-

    I know *nothing* about VB scripting, sadly; but I am pretty good at cobbling things together. I'm lost on this though.



    Say I have a form, that cycles through records of our computers at work. I would like to put a script together that reads the computer serial number and LDAP path from the current record being shown in the form, then passes that to the script below to actually move the computer in our AD.

    I am, however, completely at a loss as to how to do this. Any help would be *greatly* appreciated!

    Here is the code I found to actually do the move, once I can pass the computer serial / new path:

    http://blog.coretech.dk/jgs/vbscript-move-computer-object-to-another-ou-via-command-line-parameter/

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Put the script code in a VBA Sub procedure in Access.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    enragedcow is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    3
    Quote Originally Posted by June7 View Post
    Put the script code in a VBA Sub procedure in Access.
    So I could, for example, create a button and put that code in the "on click" procedure?

    Now, if I copy that code word for word, it's not going to know the OU path / computer name - since it's not written to pull that data from the form.

    I guess my main question is how do I modify that script to use the data shown for that record in the form?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Maybe:

    strMachineObjectOU = Me.your FIELDNAME for OUpath

    strComputerDN = Me.your FIELDNAME for ComputerName
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    enragedcow is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    3
    I'll give that a shot. Thanks! I know it's a pain in the butt trying to explain this stuff to people, so I appreciate the help. This is unfortunately not my field, and everyone I work with who *could * do this is neck deep in a bunch of other projects.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form that lost its redered record
    By alvaro.mendoza in forum Forms
    Replies: 1
    Last Post: 10-17-2011, 03:06 PM
  2. form lost in gmail
    By vespid in forum Import/Export Data
    Replies: 1
    Last Post: 03-13-2011, 01:58 PM
  3. Replies: 9
    Last Post: 02-15-2011, 03:05 PM
  4. Replies: 3
    Last Post: 01-31-2011, 11:47 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums