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.
Sub cmdReport_Click()
Dim LastRunDate As Date
Dim AllowReport As Boolean
LastRunDate = DMax("LastRunDate", "tblRunDate")
If IsNull(LastRunDate) Then
AllowReport = True
CurrentDb.Execute "INSERT INTO tblRunDate (LastRunDate) " & _
"VALUES(#" & Date & "#)"
ElseIf LastRunDate < Date Then
AllowReport = True
CurrentDb.Execute "UPDATE tblRunDate " & _
"SET LastRunDate = #" & Date & "#"
Else
AllowReport = False
End If
If AllowReport Then
[COLOR=Green]' Run the Report[/color]
Else
MsgBox "Report has already been run today."
End If
End Sub