Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 4th, 2005, 01:32 PM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default command to exit access??

Hi All,

Please help...

I have a command line to open Access and execute a macro. But how do I close Access when the macro is executed successfully?

Thanks in advance!!

To open Access and execute macro:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "\\database\mydb.mdb" /xMyMacro


  #2 (permalink)  
Old August 4th, 2005, 01:37 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Is your macro written in VBA? If so, just add a line at the end and type...

Application.Quit

Hope that helps

Mike

Mike
EchoVue.com
  #3 (permalink)  
Old August 4th, 2005, 03:09 PM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by echovue
 Is your macro written in VBA? If so, just add a line at the end and type...

Application.Quit

Hope that helps

Mike

Mike
EchoVue.com

Mike,

Thanks much for the quick response.

No, it is scheduled through Windows scheduler. Any ideas?? Thanks.


Start/All Programs/Accessories/System Tools/Scheduled Tasks/Add Scheduled Task

  #4 (permalink)  
Old August 4th, 2005, 03:20 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Are you able to edit the Macro itself?

Mike
EchoVue.com
  #5 (permalink)  
Old August 8th, 2005, 02:35 AM
Friend of Wrox
 
Join Date: Jul 2005
Location: Oklahoma City, OK, USA.
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I agree with Mike, you have to add the command within the Access MDB. It does not matter how you open the MDB.

After all the procesing is done within the Access MDB, then you add the Access command to "Quit".

Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com
  #6 (permalink)  
Old August 12th, 2005, 09:04 AM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks to echovue and AccessMaster!!

There were two problems for my problem:
The vesion of my Access is 2003 and the db version is 2002 so I was using the wrong version to open the db.
After I changed the following from
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "\\database\mydb.mdb" /xMyMacro
to
"C:\Program Files\Microsoft Office\OFFICE10\MSACCESS.EXE" "\\database\mydb.mdb" /xMyMacro
and
added the Quit/Exit action to the macro I was executing, it was working like a charm.

Thanks to all of your prompt responses. I really appreciate it.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Force users to exit access application giswim Access 10 January 31st, 2014 04:27 AM
Access application exit button generate lock ayazhoda Access VBA 1 June 17th, 2008 10:28 AM
You can't exit Microsoft Access now jack123 Access VBA 0 July 26th, 2007 02:32 PM
Using command buttons in Access kelljw Access VBA 10 July 5th, 2006 12:42 PM
Using command buttons in Access kelljw BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 July 4th, 2006 07:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.