Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If IsError(DLookup(Date, "tblMacroLog")) = True Then
'Routine to write date to table
Else
'Code to halt macro here
End if
[code]
If you need help with code, let me know.
Hope this helps.
Tom
[COLOR=green]Born once die twice; born twice die once.[/color]
LogID..........AutoNumber (PrimaryKey)
RunDate........Date
[COLOR=blue]Public Function[/color] MacroLog()
[COLOR=green]'*****VARIABLE DECLARATION*****[/color]
[COLOR=blue]Dim[/color] strSQL [COLOR=blue]As[/color] String, RecCount [COLOR=blue]As[/color] Long
RecCount = DCount("[RunDate]", "tblMacroLog", "[RunDate] = Date()")
[COLOR=blue]If[/color] RecCount >= 1 [COLOR=blue]Then[/color]
[COLOR=green]'Today's date found in RunDate Field - halt macro[/color]
DoCmd.RunMacro "HaltDailyMacro"
[COLOR=blue]Else[/color]
[COLOR=green]'date not found - add to table[/color]
strSQL = "INSERT INTO tblMacroLog ( RunDate )" _
& "VALUES (DATE());"
DoCmd.RunSQL strSQL
[COLOR=blue]End If
End Function[/color]