I’m having difficulty with the results from a query that that is run from a combo box. This maybe very basic, but just can’t figure it out.
There is a form with a few combos with drops downs for customers, contacts, etc... The bound column is 1 which is the ID of the customer, contact, etc.
The query I use to transfer to an excel spreadsheet has this in the criteria for the customer and contact
If I fill both combos, the query works fine. But if I leave the contact combo blank and run the query, I get everything with the customer IDs that have that ID in it. For example, if I pick a company like ABC Company that has a company ID of “1”, then I also get all the other companies with the number 1 in the Company ID.
How can I make this so that it only returns the records with the company id that is in the drop down.
Thanks
There is a form with a few combos with drops downs for customers, contacts, etc... The bound column is 1 which is the ID of the customer, contact, etc.
The query I use to transfer to an excel spreadsheet has this in the criteria for the customer and contact
Code:
Like "*" & [Forms]![frmSummary].[Form]![cboCustomer] & "*"
Like "*" & [Forms]![frmSummary].[Form]![cboContact] & "*"
If I fill both combos, the query works fine. But if I leave the contact combo blank and run the query, I get everything with the customer IDs that have that ID in it. For example, if I pick a company like ABC Company that has a company ID of “1”, then I also get all the other companies with the number 1 in the Company ID.
How can I make this so that it only returns the records with the company id that is in the drop down.
Thanks