I have been trying to build a simple function that looks at the MSysObjects table for a specific Id and compares the DateUpdate field to the current date. If the DateUpdate date is not equal to today the function returns true. Pretty simple. I thought I could do this with a SQL statement and this is as far as I get:
Public Function CheckTableUpdate(lngID As Long)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = “SELECT IIf(Format([DateUpdate],””mmddyyy””)<Format(Date()," _
& """mmddyyy""),[DateUpdate],"") AS DtUpdate" _
& "FROM MSysObjects;"
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
At this line I get an error Object variable of With Block variable not set.
The rest would be an if statement to check the DtUpdate field for null.
Any help would be appreciated.