Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2003
    Posts
    123

    Unanswered: Start a Macro in another database

    Can I start a macro in another database from my database?

    I have a linked importer that imports textfiles into 5 other databases.
    After the import the macro "Refresh" has to be run in each of the databases.

    I want to run the macros from my linked importer. Is that possible?
    Like making a link to the macros and then execute them from my local macro.

  2. #2
    Join Date
    Jul 2003
    Posts
    123
    <bump>

    Anyone?

  3. #3
    Join Date
    Oct 2003
    Posts
    21

    Re: Start a Macro in another database

    Originally posted by oneleg_theone
    Can I start a macro in another database from my database?

    I have a linked importer that imports textfiles into 5 other databases.
    After the import the macro "Refresh" has to be run in each of the databases.

    I want to run the macros from my linked importer. Is that possible?
    Like making a link to the macros and then execute them from my local macro.


    In VBA.......

    Call Shell("msaccess.exe db2.mdb /x Macro1", 1)

    You may need to fully qualify the path to access and the databases, the "/x" tells access to run the macro upon opening. You could then put an exit in your macro and move on to the next database.

  4. #4
    Join Date
    Jul 2003
    Posts
    123
    Works very nice.. :-)

    Now it can start the other databases and refresh them one by one.

    One problem though, I have a path that contains blanks, ex:

    "E:\Data_Central\2003-10-16 Remote databases\remote2.mdb"

    How do I get the blanks through the command?

    I get the message that it can't find the database
    "E:\Data_Central\2003-10-16.mdb" so obviously it truncates the path at the first blank.

    Suggestions anyone? Renaming the directories is not an option. :-(

  5. #5
    Join Date
    Oct 2003
    Posts
    21
    Originally posted by oneleg_theone
    Works very nice.. :-)

    Now it can start the other databases and refresh them one by one.

    One problem though, I have a path that contains blanks, ex:

    "E:\Data_Central\2003-10-16 Remote databases\remote2.mdb"

    How do I get the blanks through the command?

    I get the message that it can't find the database
    "E:\Data_Central\2003-10-16.mdb" so obviously it truncates the path at the first blank.

    Suggestions anyone? Renaming the directories is not an option. :-(
    Try some extra quotes like........

    Call Shell("msaccess ""c:\folder with blanks\db1.mdb"" /x macro1", 1)

  6. #6
    Join Date
    Jul 2003
    Posts
    123
    Yes! Tnx a lot. Now it works, this will save a lot of time. Now I can start the Importer and forget it until it is done.

Posting Permissions

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