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.
Public Function RunOncez()
Dim dbs As Database
Dim rst As Recordset
Dim strSQL
Set dbs = CurrentDb
strSQL = "SELECT Max(Format([date]," & Chr(34) & "yyyy" & Chr(34) & ")) AS Year FROM tblDate"
Set rst = dbs.OpenRecordset(strSQL)
If Format(Now(), "yyyy") <> rst.Fields(0).Value Then
With rst
.AddNew
.Fields(0).Value = Now()
.Update
End With
DoCmd.OpenQuery(“Your Query”)
Else
End If
End Function
Dim cnn as connection
Dim rst as New ADODB.Recordset
Dim strSQL
Set cnn = CurrentProject.Connection
Cnn Open."Provider = Microsoft.Jet.OLEDB 4.0; Source = "YourDatabase.mdb"
strSQL = "SELECT Max(Format([date]," & Chr(34) & "yyyy" & Chr(34) & ")) AS Year FROM tblDate"
rst.Open strSQL
If Format(Now(), "yyyy") <> rst.Fields(0).Value Then
With rst
.AddNew
.Fields(0).Value = Now()
.Update
End With
DoCmd.OpenQuery(“Your Query”)
Else
End If
End Function