PC Review


Reply
Thread Tools Rate Thread

Triggering an event

 
 
David S.
Guest
Posts: n/a
 
      16th Apr 2004
Hello,

I'd like to trigger an event using the ontimer property
at 5am during the weekdays. It needs to be done within
Access and not the Task Scheduler.

I'd appreciate any thoughts or ideas you may have.

Thanks
David S.
 
Reply With Quote
 
 
 
 
Graham R Seach
Guest
Posts: n/a
 
      16th Apr 2004
David,

The only way to do it is to have Access running all the time, with a hidden
form open all the time. The form's TimerInterval can be set to 60000 (1
minute) to regularly trigger the Timer event which should then compare the
current day and time to weekdays at 5AM.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"David S." <(E-Mail Removed)> wrote in message
news:1d38301c4234b$17dbd9e0$(E-Mail Removed)...
> Hello,
>
> I'd like to trigger an event using the ontimer property
> at 5am during the weekdays. It needs to be done within
> Access and not the Task Scheduler.
>
> I'd appreciate any thoughts or ideas you may have.
>
> Thanks
> David S.



 
Reply With Quote
 
David S.
Guest
Posts: n/a
 
      16th Apr 2004
Thanks Graham. What would the code look like to compare
the current day to the weekday time?

David S.

>-----Original Message-----
>David,
>
>The only way to do it is to have Access running all the

time, with a hidden
>form open all the time. The form's TimerInterval can be

set to 60000 (1
>minute) to regularly trigger the Timer event which

should then compare the
>current day and time to weekdays at 5AM.
>
>Regards,
>Graham R Seach
>Microsoft Access MVP
>Sydney, Australia
>
>Microsoft Access 2003 VBA Programmer's Reference
>http://www.wiley.com/WileyCDA/WileyTitle/productCd-

0764559036.html
>
>
>"David S." <(E-Mail Removed)> wrote

in message
>news:1d38301c4234b$17dbd9e0$(E-Mail Removed)...
>> Hello,
>>
>> I'd like to trigger an event using the ontimer property
>> at 5am during the weekdays. It needs to be done within
>> Access and not the Task Scheduler.
>>
>> I'd appreciate any thoughts or ideas you may have.
>>
>> Thanks
>> David S.

>
>
>.
>

 
Reply With Quote
 
Graham R Seach
Guest
Posts: n/a
 
      19th Apr 2004
David,

'Put this in the declarations section
Private vLastDone As Variant

Private Sub Form_Timer()
'Fire an action at 5AM on weekdays
Dim tm As Date

tm = Now()

'Only check if vLastDone < today, which indicates
'that the last time the "action" was carried out was
'some time before today. This prevents the "action"
'being carried out more than once per day.
If Nz(vLastDone, tm - 1) < tm Then
'Check that it's a weekday
If Weekday(tm + 5, vbMonday) < 6 Then
'Check that it's 5AM
If format(tm, "hhnn") = "0500" Then
'Indicate that the "action" has been carried
'out for this day, so it doesn't happen again.
vLastDone = Date

'Do whatever you like!
End If
End If
End If
End Function

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"David S." <(E-Mail Removed)> wrote in message
news:1da2801c42380$c254a610$(E-Mail Removed)...
> Thanks Graham. What would the code look like to compare
> the current day to the weekday time?
>
> David S.
>
> >-----Original Message-----
> >David,
> >
> >The only way to do it is to have Access running all the

> time, with a hidden
> >form open all the time. The form's TimerInterval can be

> set to 60000 (1
> >minute) to regularly trigger the Timer event which

> should then compare the
> >current day and time to weekdays at 5AM.
> >
> >Regards,
> >Graham R Seach
> >Microsoft Access MVP
> >Sydney, Australia
> >
> >Microsoft Access 2003 VBA Programmer's Reference
> >http://www.wiley.com/WileyCDA/WileyTitle/productCd-

> 0764559036.html
> >
> >
> >"David S." <(E-Mail Removed)> wrote

> in message
> >news:1d38301c4234b$17dbd9e0$(E-Mail Removed)...
> >> Hello,
> >>
> >> I'd like to trigger an event using the ontimer property
> >> at 5am during the weekdays. It needs to be done within
> >> Access and not the Task Scheduler.
> >>
> >> I'd appreciate any thoughts or ideas you may have.
> >>
> >> Thanks
> >> David S.

> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triggering event after a few seconds techlra Microsoft C# .NET 0 27th Jul 2010 10:59 PM
'Before update' event triggering Dorian Microsoft Access Form Coding 5 6th Apr 2009 10:23 PM
Triggering AfterUpdate Event Ripan Microsoft Excel Misc 2 10th Feb 2004 03:54 PM
Re: Triggering an event Woody Splawn Microsoft VB .NET 1 25th Aug 2003 08:02 PM
Delete not triggering event? Judy Microsoft Access Form Coding 3 18th Jul 2003 07:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:27 PM.