![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 - |
![]() |
| Thread Tools | |
| Display Modes | |
| |