Access 2003/Windows XP
I have several multi select listboxes on a form. No selection by the user is currently coded as if the user selected all:
If Len(strAVP) = 0 Then
strAVP = "Like '*'"
this is repeated for all the list boxes and a query is then run using:
strSQL = "SELECT tbl.* tbl " &
"Where AVP " & strAVP & " AND " & _
";"
The code works perfectly.
For this case, it would be great if a len(0) actually meant to exclude that field from the query. What would the SQL string need to read? "Select tbl.* from tbl EXCEPT/BUT/NOT ?? None of these commands seem to work. Any suggestions would be great.
I have several multi select listboxes on a form. No selection by the user is currently coded as if the user selected all:
If Len(strAVP) = 0 Then
strAVP = "Like '*'"
this is repeated for all the list boxes and a query is then run using:
strSQL = "SELECT tbl.* tbl " &
"Where AVP " & strAVP & " AND " & _
";"
The code works perfectly.
For this case, it would be great if a len(0) actually meant to exclude that field from the query. What would the SQL string need to read? "Select tbl.* from tbl EXCEPT/BUT/NOT ?? None of these commands seem to work. Any suggestions would be great.
Comment