D
Don
I have a complex query that takes about 7 to 10 minutes to run as a result of
a "Like" expression over a network. I would like to run this query early in
the morning when the staff are not yet at work and after an auto update of
imported data. So far what I can figure out is I can use code to have the
timer perform the below:
Private Sub Form_Timer()
Dim stDocName As String
‘ If time is after 05:00 AM Then run Macro named "Append & Update Linked
Tables to Me tables"
If Time() > #5:00:00 AM# Then
stDocName = "Append & Update Linked Tables to Me tables"
DoCmd.RunMacro stDocName
End If
End Sub
The problem I am having is I need to somehow use a registry setting to store
the date last run, this way it won't try to run more than once per day. I
can even hide the form so it is not intrusive.
The following is what the help suggests but I do not know what to put where
and I need someone to breakdown it down to me and how do I know where to save
the settings in the Registry?
'GetSetting(appname, section, key[, default])
Dim MySettings As Variant
' Place some settings in the registry.
SaveSetting "MyApp","Startup", "Top", 75
SaveSetting "MyApp","Startup", "Left", 50
GetSetting(appname := "MyApp", section := "Startup", _
key := "Left", default := "25")
DeleteSetting "MyApp", "Startup"
Thanks,
Dennis
a "Like" expression over a network. I would like to run this query early in
the morning when the staff are not yet at work and after an auto update of
imported data. So far what I can figure out is I can use code to have the
timer perform the below:
Private Sub Form_Timer()
Dim stDocName As String
‘ If time is after 05:00 AM Then run Macro named "Append & Update Linked
Tables to Me tables"
If Time() > #5:00:00 AM# Then
stDocName = "Append & Update Linked Tables to Me tables"
DoCmd.RunMacro stDocName
End If
End Sub
The problem I am having is I need to somehow use a registry setting to store
the date last run, this way it won't try to run more than once per day. I
can even hide the form so it is not intrusive.
The following is what the help suggests but I do not know what to put where
and I need someone to breakdown it down to me and how do I know where to save
the settings in the Registry?
'GetSetting(appname, section, key[, default])
Dim MySettings As Variant
' Place some settings in the registry.
SaveSetting "MyApp","Startup", "Top", 75
SaveSetting "MyApp","Startup", "Left", 50
GetSetting(appname := "MyApp", section := "Startup", _
key := "Left", default := "25")
DeleteSetting "MyApp", "Startup"
Thanks,
Dennis