Ok I am probably missing something obvious so any help would be appreciated....
The original record source for a form is as follows:
Code:SELECT tblTablename.*, DCount("Field1","tblTable2","Field1='" & [Field2] & "'") AS UseCount FROM tblTableName;
The user can run a filter to change data on the form which works fine until I try and reset the record source to the above information:
I know the problem is with the “quotes”, but I cannot remember how to work around that.
I want to end up something like:
Code:Form_MYFORM.RecordSource = “SELECT tblTablename.*, DCount("Field1","tblTable2","Field1='" & [Field2] & "'") AS UseCount FROM tblTableName;”