duplicate emails sent when using MS's Scheduled Tasks (1 Viewer)

sjl

Registered User.
Local time
Today, 16:32
Joined
Aug 8, 2007
Messages
221
Good morning,

I've finally got my email notifications sent via SMTP, and if (while the database is open) I activate the Form whose VBA generates the email, just one set of notifications is sent.

And, if I double click the database's Macro which the Scheduled Task uses to begin the process (Open Form: frmEmail_Notif_onOpen_SMTP), just one set of notifications is sent.

However, when I actually schedule the task to run "Once" at XX:XX time, using this trigger: X mcrOpenEmailNotif_SMTP, 2 copies of each email are sent. (My database is not open when the Scheduled Task runs)

Any ideas why this might be happening?

thanks,
Sarah
 

ajetrumpet

Banned
Local time
Today, 15:32
Joined
Jun 22, 2007
Messages
5,638
what IS the task? what does it do? you say the task when the DB is open, is to send an email through a form on open. but when the windows task is run, the same thing is happening WITHOUT the db being open? Explain that. that makes no sense. :)

what IS the task? what does it do? what is X mcrOpenEmailNotif_SMTP?? is it a program? a script?
 

marianne

Registered User.
Local time
Today, 13:32
Joined
Mar 26, 2009
Messages
327
can you attach your database file here along with your forum so we can analyze it better? please attach it on an ms access 2000 version.
 

sjl

Registered User.
Local time
Today, 16:32
Joined
Aug 8, 2007
Messages
221
Does anybody see what would trigger 2 emails from being sent using the following code on the Windows Start button | Run (or, in a Scheduled Task):

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
H:\IRB\SMTP\Reg_SMTP_utility.mdb /WRKGRP
H:\IRB\SMTP\security.mdw /User "xxyz" /pwd "xxxxxxx"
/X mcrSMTP.mcr_SMTP_NIEHS

The macro named after the "/x" switch merely opens a form, whose OnOpen funtionality runs some VBA code that sends an email reminder (if needed).

This exact code worked famously when my VBA code sent the email via Outlook. But, now that I have re-vamped the code to send notifications via SMTP, duplicate messages are sent out. (I have run the SMTP macro while IN the database, and only ONE email is sent, so it has something to do with the switches/code above).

thanks
sjl
 

sjl

Registered User.
Local time
Today, 16:32
Joined
Aug 8, 2007
Messages
221
Solved it. Not sure exactly how this solves it, but for security reasons I had unchecked the "Display Database Window" in the Startup window. If I re-check this, my issue is solved....I no longer get duplicates.

sjl
 

Users who are viewing this thread

Top Bottom