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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top