R
Rachel
Hi,
I have a subform 'OrderDetailsSubform' (datasheet view) on which I have 3
combo boxes - cboCategories, cboSizes, cboProducts. They are all synchronised
to filter down by selecting Product Category, Product Size, then the Product
itself. The subform's controlsource is a query OrderDetailsExtended.
The next field is an text box txtUnitPrice. I want this to populate with the
price for the product selected in the combo boxes.
I am stumped however, as the ProductID (which is what would distinctly
identify the product and the price) isn't actually selected in any of these
combo boxes.
I tried making cboProducts display the ProductID and ProductName but when
moving to the next row/record the previous row blanks out.
I hope this makes sense?!
How do I get this to work? I have tried placing a Dlookup in the
txtUnitPrice such as:
=DLookup("UnitPrice", "Products", "ProductName = " & [cboproducts]) but as
the are products of the same name but different sizes (and therefore
different prices) this wouldn't work.
I thought to of putting 3 criteria into the Dlookup (if thats possible) so
that Category, Size and ProductName must be found but have know idea how to
write it.
Then I guess there is a way to do this with a query but I can't get my head
around that!
Any help would be great!!!!
Rachel
I have a subform 'OrderDetailsSubform' (datasheet view) on which I have 3
combo boxes - cboCategories, cboSizes, cboProducts. They are all synchronised
to filter down by selecting Product Category, Product Size, then the Product
itself. The subform's controlsource is a query OrderDetailsExtended.
The next field is an text box txtUnitPrice. I want this to populate with the
price for the product selected in the combo boxes.
I am stumped however, as the ProductID (which is what would distinctly
identify the product and the price) isn't actually selected in any of these
combo boxes.
I tried making cboProducts display the ProductID and ProductName but when
moving to the next row/record the previous row blanks out.
I hope this makes sense?!
How do I get this to work? I have tried placing a Dlookup in the
txtUnitPrice such as:
=DLookup("UnitPrice", "Products", "ProductName = " & [cboproducts]) but as
the are products of the same name but different sizes (and therefore
different prices) this wouldn't work.
I thought to of putting 3 criteria into the Dlookup (if thats possible) so
that Category, Size and ProductName must be found but have know idea how to
write it.
Then I guess there is a way to do this with a query but I can't get my head
around that!
Any help would be great!!!!
Rachel