Sub chk()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Query3", dbOpenDynaset)
If rs.RecordCount = 0 Or rs.Fields(Format("maxof_EndDateTime", YYYYMMDD").Value) <> Format(Now(), "YYYYMMDD") Then
'03/12/09 add the new check if date is not equal to today's date
'Not completed yet
rs.Close
Set rs = Nothing
TestInfoCom = NothingToDo
Exit Function
' Else: MsgBox ("aaaa")
End If
End Sub
I've slightly change the condition , this function should be failed whten the REcordCount = 0 its perfectly fine but now I would like to add even if the value exist but its not equal to today's date then it should be failed as well, I'm getting following error when I run
Run-time error '424'
Object Required
I appreciate if any one can help
Many thanks
FArhan
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Query3", dbOpenDynaset)
If rs.RecordCount = 0 Or rs.Fields(Format("maxof_EndDateTime", YYYYMMDD").Value) <> Format(Now(), "YYYYMMDD") Then
'03/12/09 add the new check if date is not equal to today's date
'Not completed yet
rs.Close
Set rs = Nothing
TestInfoCom = NothingToDo
Exit Function
' Else: MsgBox ("aaaa")
End If
End Sub
I've slightly change the condition , this function should be failed whten the REcordCount = 0 its perfectly fine but now I would like to add even if the value exist but its not equal to today's date then it should be failed as well, I'm getting following error when I run
Run-time error '424'
Object Required
I appreciate if any one can help
Many thanks
FArhan