dbTalk Databases Forums  

using On Timer event

comp.databases.ms-access comp.databases.ms-access


Discuss using On Timer event in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bobh
 
Posts: n/a

Default using On Timer event - 11-22-2011 , 01:01 PM






Hi All,

In AccessXP I have a form, in the form's open event I have code to
check for a date in an attached table and if it is there I continue to
run the vba code in the open event. If the date is not there I want
the code to check again in 15 mins so, I thought I might use the Timer
Interval and On Timer event but I don't know if that would actually
work.

the senario
On Open of the form --> check for date in table
If there, continue to run the vba code and exit
If the date is not there, using vba set the Timer Interval to 15 mins
and exit the sub but leave the form open so in 15 minutes it will run
the code in the On Open event again via a call form open sub from the
On Timer event

has anybody done this kind of thing before? will it work?
what is the value I would enter in the Timer Interval? I know it's not
15
when I add a value to the Timer Interval does the time start ticking
right away?
got any vba code you can share?

thanks
bobh.

Reply With Quote
  #2  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: using On Timer event - 11-22-2011 , 01:28 PM






On Nov 22, 1:01*pm, bobh <vulca... (AT) yahoo (DOT) com> wrote:
Quote:
Hi All,

In AccessXP I have a form, in the form's open event I have code to
check for a date in an attached table and if it is there I continue to
run the vba code in the open event. If the date is not there I want
the code to check again in 15 mins so, I thought I might use the Timer
Interval and On Timer event but I don't know if that would actually
work.

the senario
On Open of the form --> check for date in table
If there, continue to run the vba code and exit
If the date is not there, using vba set the Timer Interval to 15 mins
and exit the sub but leave the form open so in 15 minutes it will run
the code in the On Open event again via a call form open sub from the
On Timer event

has anybody done this kind of thing before? will it work?
what is the value I would enter in the Timer Interval? I know it's not
15
when I add a value to the Timer Interval does the time start ticking
right away?
got any vba code you can share?

thanks
bobh.
Sure. Why not. Initially the OnTimer event is set to 0. Then on the
if branch that checks if the date exists, you cancel the forms OnOpen
event. Otherwise you set the OnTimer value to 1000 * 60 *15 (900000)
to set the timer to 15 minutes.
If Not IsNull([TableDate]) then
Msgbox "Keep on Trucking!"
Cancel = True
Else
Msgbox "Wake me up in 15 minutes."
Me.TimerInterval = 900000
endif

In the OnTimer event have something like
Me.TimerInterval = 0
Form_Open 0 'form_open expects a Cancel value

Reply With Quote
  #3  
Old   
bobh
 
Posts: n/a

Default Re: using On Timer event - 11-23-2011 , 12:25 PM



On Nov 22, 2:28*pm, Patrick Finucane <patrickfinucan... (AT) gmail (DOT) com>
wrote:
Quote:
On Nov 22, 1:01*pm, bobh <vulca... (AT) yahoo (DOT) com> wrote:



Hi All,

In AccessXP I have a form, in the form's open event I have code to
check for a date in an attached table and if it is there I continue to
run the vba code in the open event. If the date is not there I want
the code to check again in 15 mins so, I thought I might use the Timer
Interval and On Timer event but I don't know if that would actually
work.

the senario
On Open of the form --> check for date in table
If there, continue to run the vba code and exit
If the date is not there, using vba set the Timer Interval to 15 mins
and exit the sub but leave the form open so in 15 minutes it will run
the code in the On Open event again via a call form open sub from the
On Timer event

has anybody done this kind of thing before? will it work?
what is the value I would enter in the Timer Interval? I know it's not
15
when I add a value to the Timer Interval does the time start ticking
right away?
got any vba code you can share?

thanks
bobh.

Sure. *Why not. *Initially the OnTimer event is set to 0. *Then on the
if branch that checks if the date exists, you cancel the forms OnOpen
event. *Otherwise you set the OnTimer value to 1000 * 60 *15 (900000)
to set the timer to 15 minutes.
If Not IsNull([TableDate]) then
* Msgbox "Keep on Trucking!"
* Cancel = True
Else
* Msgbox "Wake me up in 15 minutes."
* Me.TimerInterval = 900000
endif

In the OnTimer event have something like
* Me.TimerInterval = 0
* Form_Open 0 *'form_open expects a Cancel value- Hide quoted text -

- Show quoted text -
ok, thanks for your reply.......
bobh.

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.