Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    pompano beach, FL
    Posts
    8

    Red face Unanswered: How can I automate Macros and Queries??

    I need to have a macro and four queries automated by including them in a .bat file. Can anyone help me with this? Any help would be greatly appreciated. Thanks.

  2. #2
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    The batch file could be like this...

    c:
    cd\C:\Program Files\Microsoft Office\Office
    MSACCESS C:\myFolder\myPath\myGoodness\MyDB.mdb /x myMacro


    line 1 moves to the drive you want
    line 2 goes to the path where access is
    line 3 opens Access in 3 parts: a:Access is started, b:the database you want is specified, c: the parameter /x will run a macro that you specify

    The macro could run the queries and call the other macros. The macro could also tell access to quit (I think). Check the help to make sure the parameter is correct.

    Try that and let me know if it works.
    Last edited by jpshay; 06-27-02 at 08:06.
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  3. #3
    Join Date
    Apr 2002
    Location
    pompano beach, FL
    Posts
    8

    Thanks for your help!!!!

    Hi jpshay, your advise was good. I was able to open the database from a .bat file, but, there still a bigger problem. The database is linked to a SQL7 server database, that's where it gets its data from. When I open the database, I have to connect all links to the SQL server. The odbc connection was created with a user name and a blank password. Therefore, I need a way to include the user info in the .bat file. Thanks.









    Tcharly

  4. #4
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    If I knew that, we'd both be tickled. I think I'll start a new question.
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

Posting Permissions

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