A "push" function to produce an email on an event

  • Thread starter TonyWilliams via AccessMonster.com
  • Start date
T

TonyWilliams via AccessMonster.com

Someone has asked me to create a database and include what they call a "push"
function that will automatically create an email to warn that a contract
renewal date is imminent. I believe that this can't be done in a desktop
application because although I can see how I can create the alert by running
a query against date parametrs, it still needs a trigger which I'm assuming
would be someone clicking a control button to run the query. I'm assuming
that what they want could only be achieved by creating the database on a
server and running a task say over night. I suppose one way would be to run
a query when the the Access application is opened? Am I right?
Tony
 
S

Stefan Hoffmann

hi Tony,

Someone has asked me to create a database and include what they call a "push"
function that will automatically create an email to warn that a contract
renewal date is imminent. I believe that this can't be done in a desktop
application because although I can see how I can create the alert by running
a query against date parametrs, it still needs a trigger which I'm assuming
would be someone clicking a control button to run the query. I'm assuming
that what they want could only be achieved by creating the database on a
server and running a task say over night. I suppose one way would be to run
a query when the the Access application is opened? Am I right?
Partially. Basically you can do it all in Access. And you need the
correct 'trigger'. You can use the Scheduled Tasks to run Access at a
give time every day to do this.

http://technet.microsoft.com/en-us/library/bb726974.aspx
http://support.microsoft.com/kb/209207

But sending E-Mail in such an task may be diffcult as it depends on your
mail system how to do it. It's not an beginner or intermediate task at all.


The better approach may be: Use Outlook and create calender/to-do
entries for these contracts to review.

mfG
--> stefan <--
 
T

TonyWilliams via AccessMonster.com

Thanks Stefan. I've had a look at Scheduled Tasks and it appears to run a
named application. Is it possible to create a task that runs a partricular
query in a specified database? Presumably the same would apply to using
Outlook in that Outlook would only alert that the task needs to be run but
owukdn't actually run the query?
Thanks
Tony

Stefan said:
hi Tony,
Someone has asked me to create a database and include what they call a "push"
function that will automatically create an email to warn that a contract
[quoted text clipped - 5 lines]
server and running a task say over night. I suppose one way would be to run
a query when the the Access application is opened? Am I right?
Partially. Basically you can do it all in Access. And you need the
correct 'trigger'. You can use the Scheduled Tasks to run Access at a
give time every day to do this.

http://technet.microsoft.com/en-us/library/bb726974.aspx
http://support.microsoft.com/kb/209207

But sending E-Mail in such an task may be diffcult as it depends on your
mail system how to do it. It's not an beginner or intermediate task at all.

The better approach may be: Use Outlook and create calender/to-do
entries for these contracts to review.

mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Tony,

Thanks Stefan. I've had a look at Scheduled Tasks and it appears to run a
named application. Is it possible to create a task that runs a partricular
query in a specified database?
Take a look at the Access command-line options link. You can specify a
macro to run.

imho the better approach is to create an extra database (front-end) for
that task. The task itself is started with the AutoExec macros Run Code
action.

In this called method you can now run your query to check whether you
have to create E-Mails /or task items. This can be done by using Outlook
automation:

http://msdn.microsoft.com/en-us/library/aa209963(office.11).aspx
http://support.microsoft.com/kb/161088

and

http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-Without-Security-Warning
Presumably the same would apply to using
Outlook in that Outlook would only alert that the task needs to be run but
owukdn't actually run the query?

http://msdn.microsoft.com/en-us/library/aa209963(office.11).aspx


mfG
--> stefan <--
 
T

TonyWilliams via AccessMonster.com

Thanks again Stefan, this is getting a little beyond my level of expertise so
I will need some time to study the content of those links.
Thanks again
Cheers
tony
 
T

TonyWilliams via AccessMonster.com

At long last I've figured out the Scheduled Task procedure in Windows and now
have this as the command

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" "C:\Documents and
Settings\Owner\My Documents\TimeandBilling.accdb /X macinvoice"

However it doesn't work. When I look at the Scheduled Task it says Could not
start in the status.

Anyone help?
Thanks
Tony
 
S

Stefan Hoffmann

hi Tony,

However it doesn't work. When I look at the Scheduled Task it says Could not
start in the status.
I see, you have the quotation marks wrong, it should be (without line
breaks and with correct spacing):

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
"C:\Documents and Settings\Owner\My Documents\TimeandBilling.accdb"
/X macinvoice


mfG
--> stefan <--
 
T

TonyWilliams via AccessMonster.com

Stefan this is what I've got now:
"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"(space)"C:\Documents
and Settings\Owner\My Documents\TimeandBilling.mdb"(space)/X macinvoice

It's all one line with no breaks and there are spaces instead of the word
"space"

Although the Scheduled Task appears to be created I do get an error message
when I save it which says "error occured while attempting to to set task
account information specific error is 0x80070005 access is denied"

As I said the task is saved and I don't understand why I'm getting the
message because I'm logged on as the owner.

Still no joy :-(

Tony
 
T

TonyWilliams via AccessMonster.com

Incidentally I did find a Microsft Knowledge Base article about the error
message and downloaded the hotfix but when I tried to install it I got a
message that said I didn't need it. Brick walls at every turn! LOL
Cheers
Tony
 
T

TonyWilliams via AccessMonster.com

I solved it! There is a tick box in the Scheduled Task that says Run only if
logged on. By default this is unticked and should be ticked. I would have
thought it would have been more logical to have it the other way round?
Cheers
Tony
Incidentally I did find a Microsft Knowledge Base article about the error
message and downloaded the hotfix but when I tried to install it I got a
message that said I didn't need it. Brick walls at every turn! LOL
Cheers
Tony
[quoted text clipped - 9 lines]
mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Tony,

I solved it! There is a tick box in the Scheduled Task that says Run only if
logged on. By default this is unticked and should be ticked. I would have
thought it would have been more logical to have it the other way round?
Cool that you finally solved it.


mfG
--> stefan <--
 
T

TonyWilliams via AccessMonster.com

Hi Stefan, yes really pleased a little frustrating that the problem was a
tick box though!
Thanks for all your help.
Tony
 

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