Hello everyone,
I need to set the recordsource of a form by code. I do something like this:
Forms!frmSelectCase!sfrmEvaluation.Form.RecordSource = SQLSelectCase & "WHERE...;"
SQLSelectCase is a string which contains the select cause. I am having trouble getting the WHERE clause with the correct syntax.
If I was doing it in a query the WHERE clause would be:
WHERE (((qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword1 & "*","*") And (qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword2 & "*","*") And (qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword3 & "*","*") And (qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword4 & "*","*")));
but I know since I'm doing it with VB I need to do some different things with my single and double quotes to make it a valid string; I am not sure how to adjust the above WHERE clause where I can use it in my:
Forms!frmSelectCase!sfrmEvaluation.Form.RecordSource = SQLSelectCase & "WHERE...;"
statement. Could someone help? Thanks.
Collen
I need to set the recordsource of a form by code. I do something like this:
Forms!frmSelectCase!sfrmEvaluation.Form.RecordSource = SQLSelectCase & "WHERE...;"
SQLSelectCase is a string which contains the select cause. I am having trouble getting the WHERE clause with the correct syntax.
If I was doing it in a query the WHERE clause would be:
WHERE (((qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword1 & "*","*") And (qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword2 & "*","*") And (qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword3 & "*","*") And (qryEvaluation.ProblemDescription) Like Nz("*" & Forms!frmProblemDesc!txtKeyword4 & "*","*")));
but I know since I'm doing it with VB I need to do some different things with my single and double quotes to make it a valid string; I am not sure how to adjust the above WHERE clause where I can use it in my:
Forms!frmSelectCase!sfrmEvaluation.Form.RecordSource = SQLSelectCase & "WHERE...;"
statement. Could someone help? Thanks.
Collen