Best way to setup query?

  • Thread starter Thread starter mennis
  • Start date Start date
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.
 
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
 
Back
Top