Best way to setup query?

M

mennis

I have a table with pricing data for articles of
clothing. i.e. Shirt "A" has a different price depending
on the size and color of the shirt. I want a form that
allows a user to first select the shirt type ("A") then
choose which sizes and colors they want to view the
pricing for. Ideally they could view pricing for as many
sizes and colors they want at the same time in a datasheet
view. Any advice would be greatly appreciated.
Thankyou. m.e.
 
M

Michel Walsh

Hi,

Assign the RowSource of a listbox to a query like:

SELECT type, size, color, unitprice
FROM myTable
WHERE type=FORMS!formName!ControlName
AND color IN(...)
AND size IN(...)


That statement you be produced at run time, as a string. The IN( ) clauses
can be left out when no selection of color, or of size, would have been made
(and also the condition on type, if the control is left empty, NULL). I
assume the multiple color or size selection occur in a multiple selection
list box. You can take a look at
http://www.mvps.org/access/forms/frm0007.htm to get a start on how to build
those IN list, under such circumstances.


Hoping it may help,
Vanderghast, Access MVP
 

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

Similar Threads


Top