Hi all,
I have created a form which sends an email when the button is clicked. However, I want to use multiple criteria for an SQL string which selects the recipients of the email.
Basically the end user selects criteria from one, two or three combo boxes with the idea that the SQL is build depending on the values in these boxes.
My understanding is that it should look something like below:
when I try to run the send email procedure I keep getting error messages that there is a mismatch in criteria expression.
HELP!!
I have created a form which sends an email when the button is clicked. However, I want to use multiple criteria for an SQL string which selects the recipients of the email.
Basically the end user selects criteria from one, two or three combo boxes with the idea that the SQL is build depending on the values in these boxes.
My understanding is that it should look something like below:
Code:
varwhere = "[QueryField1]=" & Me.cmbone
varcriteria = "[QueryField2]=" & Me.cmbtwo
sqlstr = "Select * From [QueryName] where " & varwhere & " OR " & varcriteria
when I try to run the send email procedure I keep getting error messages that there is a mismatch in criteria expression.
HELP!!