Printing from Macro, Opened from Batch while Logged Off (1 Viewer)

tabitha

Registered User.
Local time
Today, 15:02
Joined
Apr 24, 2015
Messages
62
I originally put this in General because it's actually a bit of everything, but if there's something I can put in my code, that's great with me. So my goal is to print a report with a list of names, a stack of letters to each person, and an envelope with each persons name on it WHILE no one is logged onto the computer. I want this to run early in the morning on the first of every month so it's there when we get to work. All of the reports and everything run, my only hang out is getting Access to actually print the reports while being logged off.

Access 2013 & Windows 10

Okay, so, I have a macro that runs everything the database needs to do, I double click, it runs, it prints; beautiful. I have created a batch file that opens the database and runs the macro; beautiful. I have a task in Task Scheduler that runs the batch file while logged off (also waking it from sleep); beautiful. The batch has logging, so I can see when it's finished, not just when it starts; beautiful.

But Access doesn't seem to be able to send the message to the printers to actually print while I'm logged off. I don't actually know if it's possible, I just kind of assumed it is. Has anybody been success with this?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:02
Joined
Aug 30, 2003
Messages
36,127
I haven't done it, but I would suspect network printers would not be available when logged off. Can you lock the machine rather than log off? I have all kinds of automated things running, and I just lock my PC.
 

tabitha

Registered User.
Local time
Today, 15:02
Joined
Apr 24, 2015
Messages
62
Locking produces the same result. The printer is actually directly connected, since it's the little one that has the manual feed for the envelopes. I can see in the Task Scheduler History that it completed, and I can see on my .log file exactly when it ended, since that's the last step of the batch file, but it just seems to skip over opening the database.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:02
Joined
Aug 30, 2003
Messages
36,127
Curious then. I don't have anything automated that prints, but I have several that send/receive emails, import data, etc, and they all run fine with the PC locked. I can't think of why Access wouldn't be able to print while the PC is locked. I'm not in the office where I can test right now, but I'll try next time I'm there (I work from home most of the time).
 

tabitha

Registered User.
Local time
Today, 15:02
Joined
Apr 24, 2015
Messages
62
Okay, so contrary to what everything I was reading, it worked as soon as I set it to only run when I'm logged on, without highest privileges!

Here's my steps:
-I wanted to see if it would run at all. At this point, it was set to Run whether or not I'm logged in, with Highest Privileges. >It flashed for a moment, but that was it. My batch file ran, because I had a success in the .log file, but Access never opened.
-I set it to run only when I'm logged on, with Highest. >Same result.
-I set it to run only when I'm logged on, unchecked Highest >Ran perfectly as expected.
-I set it again, only this time, I locked it first. >Ran perfect.
-I set it again, locked it, hit Ctrl+Alt+Del to put it to Sleep. >Ran perfect.

So turning on Highest Privileges and to run whether I'm logged on or not actually didn't help me whatsoever!

As an aside, I'm using Windows 10, so when I went to get back on, I wiggled the mouse and my name was already popped up, with a spinning circle underneath it. It just kept going, so I hit Ctrl+Alt+Del, and the screen cleared and I was then able to enter my password and sign in. I've had this happen to me when it was at an all blue screen with spinning dots, doing nothing. Ctrl+Alt+Del worked then, too.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:02
Joined
Aug 30, 2003
Messages
36,127
Glad you got it sorted, and thanks for posting the solution, as it could help somebody else.
 

Users who are viewing this thread

Top Bottom