sdhruv
06-08-2015, 08:25 PM
hi I am running this code:
Private Sub Command6_Click()
x = 0
y = ElecMLFB
Do While x < 6
Do
y = DateAdd("d", 1, y)
Loop Until DCount("*", "tblHolidays", "Holidaydate = " & Format$(y, "\#mm\/dd\/yyyy\#")) = 0
x = x + 1
Loop
sixd = y
End Sub
But, I am getting a 'Run-time error 3075'
syntax error (missing operator) in query expression "Holidaydate = "
I have obviously checked if the field names are the same, and the field is the primary key, I have also used this code in multiple other access programs and it worked perfectly then, this error has suddenly come up, I have tried to change the quotation marks but I know single quotes are only used for text.
The statement in red is the problem statement.(It isn't red in the code, I just did it to highlight the statement in question here)
Please Help.
Private Sub Command6_Click()
x = 0
y = ElecMLFB
Do While x < 6
Do
y = DateAdd("d", 1, y)
Loop Until DCount("*", "tblHolidays", "Holidaydate = " & Format$(y, "\#mm\/dd\/yyyy\#")) = 0
x = x + 1
Loop
sixd = y
End Sub
But, I am getting a 'Run-time error 3075'
syntax error (missing operator) in query expression "Holidaydate = "
I have obviously checked if the field names are the same, and the field is the primary key, I have also used this code in multiple other access programs and it worked perfectly then, this error has suddenly come up, I have tried to change the quotation marks but I know single quotes are only used for text.
The statement in red is the problem statement.(It isn't red in the code, I just did it to highlight the statement in question here)
Please Help.