I have a form that filters data by user, date range and specific value for a column, depending if checkbox is ticked or not, as below;
strWhere = " WHERE [user] in (" & Left(strIN, Len(strIN) - 1) & ") And [Month] Between [forms]![frm_user]![txtStartDate] And [forms]![frm_user]![txtEndDate]"
If Me!checkbox = True Then
strtcheck = " (Satified Vs Dissatisfied Like Dissatisfied) "
End If
strSql = strSql & strwhere & strtcheck
So what I want and I can't get it to work is, if Me!checkbox is true, than the Satified Vs Dissatisfied must be equal to Dissatisfied and then I want to pass it to the strSql, however when i run it in Access it doesn't work, can someone help?
strWhere = " WHERE [user] in ('" & Left(strIN, Len(strIN) - 1) & "') And [Month] Between [forms]![frm_user]![txtStartDate] And [forms]![frm_user]![txtEndDate]". what do theVsoperator instrtcheckmean? areSatisfied,Dissatisfiedtable attributes, form attributes or literals? thelikeoperator only makes sense when used together with the sql wildcard (%). if you appendstrtcheckto the partial where clause, you forgot the operator (AND?). what's the content ofstrIN?.