Hello All,
I am glad I am not trying to make Access vba a career, because I really suck at it, lol.
Anyways, I am hoping someone can see where I am going wrong (yet again) with my wrapping of my sql statement.
I have tried for about an hour trying different configurations, but to no avail.
I keep getting a syntax error.
This is my WHERE criteria for my sql statement
I am placing it here:
strSQL = "SELECT LightDuty.[Email Address] FROM LightDuty WHERE '" & strWhereCriteria & "'
I am glad I am not trying to make Access vba a career, because I really suck at it, lol.
Anyways, I am hoping someone can see where I am going wrong (yet again) with my wrapping of my sql statement.
I have tried for about an hour trying different configurations, but to no avail.
Code:
strWhereCriteria = LightDuty.[Email Address] = LightDuty.[Drs Excuse Exp] = DateDiff('d', Date(), [Drs Excuse Exp]) <= 14 And LightDuty.[Email Sent] = 0
I keep getting a syntax error.
This is my WHERE criteria for my sql statement
I am placing it here:
strSQL = "SELECT LightDuty.[Email Address] FROM LightDuty WHERE '" & strWhereCriteria & "'