Command line param to query

P

Peter Ivers

I need to pass three command line parameters to a report,
and have it use these as criterea on the query. I see how
to use the COMMAND function to reference the /CMD
parameter, however I have two questions:
1. Is there a way to parse out multiple values
e.g. /CMD "Key1,Key2,Key3"?
2. Is there a way to dynamically set these values as
criterea in the report, for example to set the criterea
for PersonID to Key2?
- Pete
 
M

Michel Walsh

Hi,

1. Specify the name of some myfile.ini, extract the information stored
in that file through the appropriate API, or through file scanning, with VBA
code.

2. Instead of a dumb parameter, use a VBA user defined function:

Public Function MyParam1( ) As Long
... ' do something as easy or potentially as complex as you want
MyParam1= ...
End Function

and in the query supporting the report, use MyParam1( )




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top