Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call a VBScript from within Access

Status
Not open for further replies.

bmclean2

MIS
Jul 20, 2005
22
US
What needs to be done in order to run an existing .wsf script when a button/command is selected from a form in Access? Can this be done?

Example:
I have an existing vbscript that performs a search on a file server and dumps the results into a csv file. I then open the access database, and run a function i've created to open the text file, and import into a table.

I would like to be able to do this all from within access without having to manually run the vbscript file.

Thanks..
 
A starting point:
CreateObject("WScript.Shell").Run "\path\to\script.wsf", 3, True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you...I was able to get the script to run successfully using the following code:

Set sh = CreateObject("WScript.Shell")
rc = sh.Run("c:\temp\query.wsf", 1, True)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top