query on two columns

Gazza2

Registered User.
Local time
Today, 11:21
Joined
Nov 25, 2004
Messages
184
I hope this is in the right place.

I have a form(frmCustomerSelect) with a listbox which gets its data from a query(QryCustomerSelect).

The query gets its data from a customer\supplier table, the table has two checkbox columns , one for customer and one for supplier.

When i enter an accountcode(pk) into a textbox on the form it lists all the matching customers and suppliers but i only want it to match the customers.

this is the sql data behind the query :
SELECT accountcode, Companyname, address1, Telephone
FROM TblCS
WHERE accountcode Like '**'
ORDER BY accountcode;

My question is can i add a second WHERE statement to this or do i have to create another query to select just customers and the use that query as the recordsource of QryCustomerSelect.

Thanks in advance for your help

Gareth
 
SELECT accountcode, Companyname, address1, Telephone
FROM TblCS
WHERE accountcode Like '*'
AND checkbox = True
ORDER BY accountcode;
 
Excellent rainlover works a treat

Thanks
Gareth
 

Users who are viewing this thread

Back
Top Bottom