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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a variable to an external program via script

Status
Not open for further replies.

inkognitou

Programmer
May 4, 2012
1
0
0
I have an external link button in my Item Maintenance and the following VB Script. What I need to do is pass the Item Code variable to an external custom Price Level VB.NET app I have written that accepts two arguments, the Item Code and Customer Number. What I'd like to do is pass the current Item Code from the Item Maintainance screen to my app (PriceLevels.exe). My app's parameter syntax is as follows:


PriceLevels.exe i=123456 c=55


where i is Item Code and c is Customer Number. Here's my code, but it fails to send the ItemCode data. It is always a blank/null/empty for some reason.


*******


Dim myObj

Dim myItemCode


Set myObj = CreateObject("WScript.Shell")


myItemCode = ""

myItemCode = [CI_ItemCode_bus_ItemCode$]


myObj.CurrentDirectory = "C:\Users\Arthur\Documents\Business\TechnoCom\VB Projects\Price Levels - 4\Price Levels\bin\Debug"


myObj.Run "PriceLevels.exe i=" & myItemCode & " c=18


*******


What am I doing wrong???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top