Can I start over? I really appreciate your help, but let me just explain
exactly what I'm doing. I don't think I explained it right from the
start.
I have a query that has one parameter. When I open it, it asks me for
the
job #. I enter 123456 for example, and all is good.
Now, I'm trying to call this query from another program, which I can do,
but
I want to pass on the parameter of 123456 into that query without typing
it.
I thought it could be done in the same string, for example:
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"\\tgps8\documents\Company Documents-Public\PM Department\Link Ron's
Database to PMTool\Ship Date sync.mdb" /x qryFixTask /cmd"123456"
What do you think?
Thanks, Joel
Klatuu said:
You have to have a form with a control on it to put the value of the
command
funtion in and use that control as the reference in the query.
So in the query it would be something like:
[Forms]![StartForm]![txtParam]
Then in the Load event of the form:
Me.txtParam = Command
Then run the query here.
Of course, you will want to close the form when the query completes.
--
Dave Hargis, Microsoft Access MVP
:
It didn't seem to work. The query just opened waiting for me to enter
the
parameter. Is this syntax right?
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"\\tgps8\documents\Company Documents-Public\PM Department\Link Ron's
Database to PMTool\Ship Date sync.mdb" /x mcrFixTask /cmd"223668"
Add the /cmd switch as the last parameter in the command line with
the
value
enclosed in quotes.
Then use the Command function in VBA to retrieve the value.
See Help for Command Function for more detail. Also seach for
Command
Line
Switches in Help.
--
Dave Hargis, Microsoft Access MVP
:
Hello,
I have a query that has a parameter that you need to enter. I can
call
the
query from the command line with this line of code. Can I somehow
make
it
call a parameter too. Here's an example:
This calls the query. I want it to enter the parameter too.
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"\\tgps8\documents\Company Documents-Public\PM Department\Link
Ron's
Database to PMTool\Ship Date sync.mdb" /x mcrConfirmedShipDate
Thanks for your help,
Joel