Passing command line arguments to VBA and Access

Warren

Registered User.
Local time
Today, 06:31
Joined
Apr 1, 2009
Messages
13
I am currently using Access to print reports from a Java app. I use the command line command to open Access and run a macro that runs some VBA code that prints the report and then close Access. This works great except that I can not pass any custom arguments to Access.

I am looking for a way to write a small vb? or vba? app that I can pass arguments to and print the reports from within this vb/vba app. I am familliar with the Access object and how to print the report once I have the arguments. This is how I see the command line working:

vbApp.exe dbPath reportName whereClause printerName

I do not need any kind of GUI. I am currently running Access as the Sytem user in the background.

Can someone point me in the right direction or give me some suggestions?

Thanks,

Warren
 
When you open the db use can include a string with the /cmd option. Then once the db is open you retrieve it with the 'Command'. Make sense?
 
nothing makes sense, Ken. :rolleyes:
 
I looked it up, but how do you pass more than one argument. You mean like:

/cmd dbName reportName printerName

or

/cmd dbName;reportName;printerName
 
I see the Split function. I guess I can use it like

/cmd "dbName;reportName;printerName"

Spit(args, ";")
 
Yes. You hit the nail on the head. Sorry for the delayed response, I'm ducking in and out because the boss is wondering about :p
 

Users who are viewing this thread

Back
Top Bottom