Concatenation and # delimiter not needed when the parameter is Date() function (or Now() as well).
intStore = DCount("[ReferenceNo]", "[WasteCollectionRecord]", "[DatePickedup] <= Date() - 1095")
Simpler code structure:
Code:
Private Sub Form_Load()
Dim intStore As Integer
DoCmd.Maximize
intStore = DCount("[ReferenceNo]", "[WasteCollectionRecord]", "[DatePickedup] <= Date() - 1095")
'If count of uncomplete jobs is zero display switchboardor
'Else display message box detailing amount of jobs
'and give the user the option as to whether to view these or not.
If intStore > 0 Then
If MsgBox("You Have " & intStore & " Records In Your System Older Than 3 Years" & _
vbCrLf & vbCrLf & "Would you like to see these now?", _
vbYesNo, "Record Alert.......") = vbYes Then
DoCmd.OpenReport "ArchiveReport", acViewReport, "", "", acDialog
End If
End If
End Sub