You can't pass raw data, i.e., just the account code, because at the other end (VB) it will execute what you pass as a script. Image if you wrote a script:
"ACME"
(You just pass cAccount to the script parameter)
What does this do? Well, nothing. You'd just get an error.
So you need to pass some script statements; the statements need to set-up some variable(s) and assign them a value.
So your script needs to be:
Code: Select all
cScript := "Declare MyAccount Type Character" + CHR(13) + CHR(10)
cScript := cScript + "MyAccount := '" + cCustomer + "'"
At the other end, VB will see and then execute these lines:
Declare MyAccount Type Character
MyAccount := 'ACME'
Then you can just query the value of MyAccount (variable) inside the VB report.