Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Unanswered: launch a macro from a different DB

    Does anyone know how to lauch a Macro in one database while u are in another database, or how to open one database from another, not just open for connectivity but actualy open up the db windows?
    Jim

  2. #2
    Join Date
    Mar 2002
    Location
    Sacramento, CA
    Posts
    120
    Help Files:
    OpenDatabase Method

    Michael

  3. #3
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by mrabrams
    Help Files:
    OpenDatabase Method

    Michael
    The open database method will not open a physical window with the database in it. I need to open a second instance of access with a diff database. Any ideas on that?
    Jim

  4. #4
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    What about a shell command?

  5. #5
    Join Date
    Apr 2002
    Posts
    139
    yep Rockey, it will look like:

    stAppName = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE i:\yourseconddb.mdb"
    Call Shell(stAppName, 1)


    hth

  6. #6
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Here's what I used once:

    strAccess = path to Access
    strDBPath = path to database
    strMDW = path to workgroup file

    strParameter = Chr(34) & strDBPath & Chr(34) & " /wrkgrp " & Chr(34) & strMDW & Chr(34)
    strCommandLine = strAccess & " " & strParameter

    'send the parameters to Access using shell
    Call Shell(strCommandLine, 1)

  7. #7
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by Rockey
    Here's what I used once:

    strAccess = path to Access
    strDBPath = path to database
    strMDW = path to workgroup file

    strParameter = Chr(34) & strDBPath & Chr(34) & " /wrkgrp " & Chr(34) & strMDW & Chr(34)
    strCommandLine = strAccess & " " & strParameter

    'send the parameters to Access using shell
    Call Shell(strCommandLine, 1)
    sounds like a winner to me ill give that a try
    Jim

  8. #8
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by JDionne
    sounds like a winner to me ill give that a try
    Jim
    Have u ever called a macro that is in one database from another db?
    Jim

  9. #9
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Try this:

    strAccess = path to Access
    strDBPath = path to database
    strMacro = Macro name

    strParameter = Chr(34) & strDBPath & Chr(34) & " /x " & Chr(34) & strMacro & Chr(34)
    strCommandLine = strAccess & " " & strParameter

    'send the parameters to Access using shell
    Call Shell(strCommandLine, 1)

  10. #10
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by Rockey
    Try this:

    strAccess = path to Access
    strDBPath = path to database
    strMacro = Macro name

    strParameter = Chr(34) & strDBPath & Chr(34) & " /x " & Chr(34) & strMacro & Chr(34)
    strCommandLine = strAccess & " " & strParameter

    'send the parameters to Access using shell
    Call Shell(strCommandLine, 1)

    Ill give that a try the other code worked great thanx
    Jim

Posting Permissions

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