Results 1 to 5 of 5
  1. #1
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83

    Batch Command to Run Macro Crashes


    I was wondering if anyone else had this problem: Anytime I run a batch command to run a macro with the DoCmd.OutputTO, access crashses and has to restart. But if I go into access itself and run the macro it works fine.

    Code:
     
    @echo off
    cls
    echo Running Weekly Macro
    echo  -------------------
    echo 1/1 Running Access Solution
    "C:\Program Files\Microsoft Office\OFFICE12\Msaccess.exe"  "C:\Databases\Reports\dbWeeklyProcess.mdb"  /xweeklystatusreport
    exit

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I haven't had that problem, but since nobody else has answered, can you use Windows Scheduled Tasks instead of the batch file (or if you already are, run the Access file directly). That's how I fire off Access databases doing this type of thing, and I haven't had any problems.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    When you say run the access file directly, you mean go into the application and click on the macro? I run the file by either clicking my batch file icon or running from windows scheduler and both results produce the error.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No, I'm assuming you have an autoexec macro or something to fire off your process, so Scheduled Tasks would just open the db. Sounds like you've done that and still get the error. Is the PC logged in when it errors?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    Yes the PC is logged in. I physically click the RunReport.bat file.

    I will have to look into this more, i have one database that is working fine with the OutputTo, both are the same format (.mdb) and it is a much larger report with 3 subreports so it is as complex as my reports get.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. SQL crashes access
    By max in forum Programming
    Replies: 10
    Last Post: 01-11-2012, 03:44 AM
  2. VBA Crashes Access
    By ChuckColeman1812 in forum Programming
    Replies: 5
    Last Post: 12-12-2011, 03:33 AM
  3. Replies: 3
    Last Post: 07-04-2011, 02:44 AM
  4. Text box crashes
    By mn1247 in forum Access
    Replies: 1
    Last Post: 06-25-2011, 01:33 PM
  5. run a windodws command from macro
    By broecher in forum Programming
    Replies: 5
    Last Post: 09-12-2010, 04:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums