I created a query def that uses an existing query but selects records based on data selected in a multi-select box. The logic works fine. However, I just realized that the field being used as the selection criteria should not appear in the output so "select *" can't be used.
strSQL = "select * from qryExport where listname in (" & Me.txtFilter & ")"
Set qdf = dbs.CreateQueryDef("TempExportQry", strSQL)
DoCmd.OpenQuery "TempExportQry", acViewNormal
dbs.QueryDefs.Delete "TempExportQry"
Set qdf = Nothing
Set dbs = Nothing
I tried pasting the SQL code from View SQL of the query so I could just omit the one field from the select but it is very complicated with many quote marks and it isn't working.
Is there a way to exclude one field from the output but still use it as selection criteria?
Thanks,
Alexis
strSQL = "select * from qryExport where listname in (" & Me.txtFilter & ")"
Set qdf = dbs.CreateQueryDef("TempExportQry", strSQL)
DoCmd.OpenQuery "TempExportQry", acViewNormal
dbs.QueryDefs.Delete "TempExportQry"
Set qdf = Nothing
Set dbs = Nothing
I tried pasting the SQL code from View SQL of the query so I could just omit the one field from the select but it is very complicated with many quote marks and it isn't working.
Is there a way to exclude one field from the output but still use it as selection criteria?
Thanks,
Alexis