Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ShellExecute passing parameters (2000/XP)

    I'd like to open Access from another application and, dependent on passed paramters, open a specific form and apply a filter.

    I've already searched (in here and elsewhere) for information on ShellExecute. What I can't find is a simple example where some parameters are passed to the file you want to open and then how that file deals with the parameters once its been opened <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    I'm thinking I should be able to do something similar to using open args when opening forms withing access .i.e one thing passes parameters, the one that opened can use the parameter

    Does anyone have a simple example of passing parameters to a database, and the database then dealing with those parameters.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ShellExecute passing parameters (2000/XP)

    The only "parameter" you can pass to a database in the command line is the

    /x macroname

    switch. The specified macro (which must be present in the database) will be run.

    If you want more control, you must use Automation. See WendellB

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ShellExecute passing parameters (2000/XP)

    Thanks, thinking about it a little more I think automation is probably the way to go.
    I have opened Excel from Access and then done some basic formatting of the cells. I guess this is no different.

  4. #4
    Star Lounger
    Join Date
    Nov 2005
    Location
    Edmonton, Alberta, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ShellExecute passing parameters (2000/XP)

    What about the /cmd command line option? I've never had need to use the feature, but it looks like it could be useful - what follows /cmd gets passed into the database as the value of the command() function. You could use that in your startup code to decide what to do.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ShellExecute passing parameters (2000/XP)

    That would be possible. You'd need either a startup form that inspects the result of Command() in its On Load or On Open event procedure, or an AutoExec macro that calls a VBA function that does that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •