W
Wayne-I-M
Hi
I have a number (between 200 and 1,500) report that I e mail various clients
weekly from windows scheduler.
Open Access
Run AutoExec macro
Run Code (module) - open form - wait 10 seconds - do "stuff"
The whole thing works fine "if" the form is opened manually but fails on the
scheduler - the form "must" be fully opened before I run the code as the e
mail addess take a while to load - this is the reason for waiting 10 seconds
before starting the code.
But ??? I can not seem to run the forms timer from the module - if I put
XXXOnClick then it works fine - but of course this would run the code on_open
and so I use the forms timer to hold everything up for a while.
How do I reference the form's timer from a module ? something like this
Option Compare Database
Option Explicit
Public Function mailweeklyreports()
On Error GoTo mailcharityreports_Err
DoCmd.OpenForm "frmReportSelector", acNormal, "", "", , acNormal
Call Form_frmReportSelector.Form_Timer
Exit Function
mailweeklyreports_Err:
MsgBox Err.number & vbCrLf & Err.Description
Err.Clear
End Function
Note that I am trying to call the form's timer to run this
Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 10000
End Sub
Then run this
Public Sub Form_Timer()
Dim varItem As Variant
Me.TimerInterval = 0
For Each varItem In Me.ComboReportSelector.ItemsSelected
etc
etc
etc
Any ideas would be helpful on running the forms timer from the module
Thank you
I have a number (between 200 and 1,500) report that I e mail various clients
weekly from windows scheduler.
Open Access
Run AutoExec macro
Run Code (module) - open form - wait 10 seconds - do "stuff"
The whole thing works fine "if" the form is opened manually but fails on the
scheduler - the form "must" be fully opened before I run the code as the e
mail addess take a while to load - this is the reason for waiting 10 seconds
before starting the code.
But ??? I can not seem to run the forms timer from the module - if I put
XXXOnClick then it works fine - but of course this would run the code on_open
and so I use the forms timer to hold everything up for a while.
How do I reference the form's timer from a module ? something like this
Option Compare Database
Option Explicit
Public Function mailweeklyreports()
On Error GoTo mailcharityreports_Err
DoCmd.OpenForm "frmReportSelector", acNormal, "", "", , acNormal
Call Form_frmReportSelector.Form_Timer
Exit Function
mailweeklyreports_Err:
MsgBox Err.number & vbCrLf & Err.Description
Err.Clear
End Function
Note that I am trying to call the form's timer to run this
Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 10000
End Sub
Then run this
Public Sub Form_Timer()
Dim varItem As Variant
Me.TimerInterval = 0
For Each varItem In Me.ComboReportSelector.ItemsSelected
etc
etc
etc
Any ideas would be helpful on running the forms timer from the module
Thank you