Recordsource subform Deselect columns not used

  • Thread starter Kirk via AccessMonster.com
  • Start date
K

Kirk via AccessMonster.com

I have a subform using fields from qryvendor. I am using check boxes on the
form. I want to be able to check boxes and then on the click of the run
button only those fields appear in the subform. Right now the subform is
showing the fields I have check in the check box, but it is also showing all
the other fields with #Name? in all the fields.
Here's what I have in code so far:

Dim strQuery As String
if me.check27 = -1 then
strQuery = "vendorid"
me.qryvendor_subform.Form.RecordSource = "SELECT strQuery FROM qryVendor"
End if

This should only give me the column with data for vendorid and no other
columns. How do I eliminate the other fields from the query?

Thanks,
Kirk
 
Top