Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open a Database with /x Macro option (2002, SR1)

    I would like to use the Windows scheduler to open a database and run a macro when it opens. But when I use the following run command in the scheduler: "DataAccessStudents.mdb" /x TestMacro

    The database opens but the macro named TestMacro does not run. The database will not even open at all if I place the quotes after the macro's name.

    I don't want to start the macro by naming it AutoExec because it takes about a half hour to run the macro and then the database needs to be compacted which would make it run again.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Open a Database with /x Macro option (2002, SR1)

    Try the following:

    "c:PRogram FilesMicrosoft officeOfficeMsAccess.exe" "DataAccessStudents.mdb /x TestMacro"

    This assumes that MsAccess.exe is in the folder c:PRogram FilesMicrosoft officeOffice

    HTH
    Pat

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open a Database with /x Macro option (2002, SR1)

    Thanks for your help. I found that by using your code and placing the /x TestMacro outside the quotes, I got it to work.

    "C:Program FilesMicrosoft OfficeOfficeMsAccess.exe" "DataAccessStudents.mdb" /x TestMacro
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Open a Database with /x Macro option (2002, SR1)

    I guess that's what happens when you go by memory, rather than go to a database where I could have found that info.
    Anyway glad you got it sorted out.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Open a Database with /x Macro option (2002, SR1)

    The /x TestMacro is a command line argument, and those only work when the shortcut includes the full path and filename for both the Access executable and the database being opened. You have to use quotes around a path with spaces in it, but the path to the database itself in your command line doesn't really require them since it has no spaces.
    Charlotte

Posting Permissions

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