Quit access after running code

W

Wayne-I-M

Hi

I have a report that runs overnight (to print flight tickets). This runs
from windows scheduler via a macro that runs a module to print the tickets.

I am trying to get the DoCMD.Quit event to run after the print run.

I have tried putting the quit event into the macro and also tried at the end
of the module.
Both places give me this error
****************
If you're running a Visual Basic Module that is running OLE or DDE, you may
need to interupt the module
****************

Basically trying to run the tickets then turn off access -

Any ideas would be helpful.

Thank you
 
P

pietlinden

Hi

I have a report that runs overnight (to print flight tickets).  This runs
from windows scheduler via a macro that runs a module to print the tickets.

I am trying to get the DoCMD.Quit event to run after the print run.

I have tried putting the quit event into the macro and also tried at the end
of the module.
Both places give me this error
****************
If you're running a Visual Basic Module that is running OLE or DDE, you may
need to interupt the module
****************

Basically trying to run the tickets then turn off access -

Any ideas would be helpful.

Thank you


Add a DoEvents command before the Quit command to force Access to
complete all the processes going before executing the Quit.
 
W

Wayne-I-M

Still getting the same problem.

this is the module (dead sinple as you can see so should not be any problems
but ??


Public Function PrintTicketOverNight()
DoCmd.OpenForm "frmDailyTicketRuns", acNormal, "", "", , acNormal
Call Form_frmDailyTicketRuns.PrintAllTickets_Click

DoCmd.Close acForm, "frmDailyTicketRuns", acSaveYes
DoCmd.Close acForm, "frmSwitchboard", acSaveYes

Exit Function

DoEvents
DoCmd.Quit

End Function


Everything works fine - except that access will not quit after the print run


Any ideas ?
 
A

a a r o n . k e m p f

use SQL Agent or Reporting Services
SQL Agent makes it _QUITE_ easy to run a couple of queries and then
email the results
 
A

a a r o n _ k e m p f

good catch.

I didn't even read it-- I just find it funny when people do things
like this by hand.
Personally-- if I just -HAD- to do this without a real database
engine.. then I'd use something like

www.rptsoftware.com
 
W

Wayne-I-M

Yes you're right arron. Should have set this up in sql. Oh well too late now.

: - )

As I said though. We are "really" trying (like everyone else on this form)
to get rid of all the "paper"work. In a month or so clients will be able to
log in to an on line site and log in to thier reports. So that should eb the
end of ne more "paper-trail"

OMG - I remember sending out "Faxed" reports 25 years ago and we are "still"
doing almost the same. I wonder how many trees have been used to send out
all the reports over the years.
 
W

Wayne-I-M

Missed that - I have looked a that mad little code for 2 days and must have
gone word blind. Thanks for pointing out my stupidity : - )

Well spotted - think t just took someone to look at it freshly

Many thanks
 
S

So Sorry For Poor Aaron

a a r o n _ k e m p f said:
Personally-- if I just -HAD- to do this without a real database
engine.. then I'd use something like

www.rptsoftware.com

Never met an expensive piece of third-party software you didn't like, did
you, Aaron? You get a commission or a 'finder's fee'? Does your employer
know about this extra compensation? Do you even have an employer?
 
S

So Sorry For Poor Aaron

a a r o n . k e m p f @ g m a i l . c o said:
use SQL Agent or Reporting Services
SQL Agent makes it _QUITE_ easy to run a couple of queries and then
email the results

You still got your head where the sun don't shine, doncha, aaron? Those
wouldn't help a bit. The poster already said the tables aren't in SQL Server,
so trying your approach would just be a frustrating factor.

Put on the dunce cap, and go sit on the stool facing the corner wall. Eew,
get a paper towel and wipe your head off, first.
 
A

aaron.kempf is a robot

CAUTION!
It has been determined that the message below was generated
programmatically, by a program robot ("bot") which also allows manual
intervention. This robot was created by a person or persons deliberately
trying to interfere with users of the Microsoft Access database software, and
uses the name of an actual person. As it is not possible to block posting by
this "bot", we post these cautions lest you be misled into taking the posts
as authentic and serious.
 
A

aaron.kempf is a robot

CAUTION!
It has been determined that the message below was generated
programmatically, by a program robot ("bot") which also allows manual
intervention. This robot was created by a person or persons deliberately
trying to interfere with users of the Microsoft Access database software, and
uses the name of an actual person. As it is not possible to block posting by
this "bot", we post these cautions lest you be misled into taking the posts
as authentic and serious.
 
A

a a r o n _ k e m p f

what are you talking about ?
it's a decent, cheap piece of software that does exactly what they're
trying to do.

Do I got a commission?
Are you kidding me?

You dorks around here spend _WAY_ too much time worrying about
everyone's business EXCEPT THEIR OWN.

-Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top