S
Sophie
hi
Is there a way to use a wildcard character like * in SQL?
Here is a snippet of my code:
str_a = "...... WHERE ((Q1.score = Q2.score) AND (Q2.TestID = "
str_b = ")) ORDER BY ...... "
strSQL = str_a & cboTest & str_b
Forms!frmAwards.RecordSource = strSQL
cboTest has values of 1, 2, 3... and I have added a UNION to include *
representing <All>. I currently use If,Else statements to use the code below
if cboTest = "*", and the above code otherwise.
str_a = "...... WHERE ((Q1.score = Q2.score)"
str_b = ") ORDER BY ...... "
strSQL = str_a & str_b
Forms!frmAwards.RecordSource = strSQL
The actual code is much more complicated than this, with other comboboxes to
consider as well. The code would be much cleaner if I could use the *
wildcard in SQL. How can I do this?
Sophie
Is there a way to use a wildcard character like * in SQL?
Here is a snippet of my code:
str_a = "...... WHERE ((Q1.score = Q2.score) AND (Q2.TestID = "
str_b = ")) ORDER BY ...... "
strSQL = str_a & cboTest & str_b
Forms!frmAwards.RecordSource = strSQL
cboTest has values of 1, 2, 3... and I have added a UNION to include *
representing <All>. I currently use If,Else statements to use the code below
if cboTest = "*", and the above code otherwise.
str_a = "...... WHERE ((Q1.score = Q2.score)"
str_b = ") ORDER BY ...... "
strSQL = str_a & str_b
Forms!frmAwards.RecordSource = strSQL
The actual code is much more complicated than this, with other comboboxes to
consider as well. The code would be much cleaner if I could use the *
wildcard in SQL. How can I do this?
Sophie