How to assign passthrough query into listbox rowsource

S

Sunny

Here is the situation.

Tables:Clients,Orders,OrderDetails link to SQL server
Passthrough Query:
SELECT Clients.ClientId, Clients.ClientName, Orders.OrderDate,
Orders.OrderTotal, OrderStatus
FROM Clients INNER JOIN Orders ON Orders.ClientId = Clients.ClientId

Now on my form I would like to have a listbox which show all the clients who
has plcaed the order. Also I have one check box which allows users to see
all the clients or only clients whoes order is pending. I am thinking to add
code in checkbox click event to change listbox information. Now how can I
assign my passthrough query result into rowsource property of the listbox?

Thanks.
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't put the query result in the RowSource property, but the name
of the query. You can also put an SQL string like htis:

SELECT * FROM pass_thru_query WHERE Pending = Form.chkPending

If there is a Pending column in the pass-thru query, then the above SQL
will filter the list by whatever is in the form's CheckBox "chkPending."

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQeLusIechKqOuFEgEQLDTACg625oKaGb6isArmcCzMI9T0tA8xgAnR6K
HvRWNFZ4jpFzZWOZrKsnppnb
=krAQ
-----END PGP SIGNATURE-----
 

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