I'm trying to compare a date in a table (which is in medium format) and the current date. I am using a recordset and this is the code:
Set rs = db.OpenRecordset("SELECT * FROM Alarms Where Alarms.Alarm<" & "#" & TimeValue(Time) & "#" & " And (Alarms.[Alarm Date] > " & Format(Date, "medium date") & " Or Alarms.[Alarm Date] = " & Format(Date, "medium date") & ")")
However, i'm getting an error saying that there are too few parameters (Error 3061)
Can anyone tell me how to fix this...I can't see anything wrong!
Set rs = db.OpenRecordset("SELECT * FROM Alarms Where Alarms.Alarm<" & "#" & TimeValue(Time) & "#" & " And (Alarms.[Alarm Date] > " & Format(Date, "medium date") & " Or Alarms.[Alarm Date] = " & Format(Date, "medium date") & ")")
However, i'm getting an error saying that there are too few parameters (Error 3061)
Can anyone tell me how to fix this...I can't see anything wrong!