Try and create a field on the form to display the cost, if the table has the
qty from and the qty to in two different fields, then you can try this on the
control source
=Dlookup("[Cost]","[Table Name]","[Qty From] >= " & [Qty field Name in the
form] & " And [Qty To] <= " & [Qty field Name in the form] )
That will display the cost for the qty entered.
=================================
To dispay the Total you can use
=[Qty field Name in the form] * Nz(Dlookup("[Cost]","[Table Name]","[Qty
From] >= " & [Qty field Name in the form] & " And [Qty To] <= " & [Qty field
Name in the form] ),0)
--
\\// Live Long and Prosper \\//
BS"D
DaveAlfa said:
no.....it's not that simple, as the cost price is not a fixed rate. The user
has a table to enter costs for different qty ranges.
eg Qty 1 to 10 - Cost 5.00
Qty 11 to 20 - Cost 4.50
Qty 21 to 30 - Cost 4.00
Qty 31 to 50 - Cost 3.50
etc
:
Why do you need to run a query for that?
If you have a two fields in the form, Qty and Price, then create another
field to sum the two fields, in the control source of the third field write
=[Qty] * [Price]
Or, I might be missing something.
--
\\// Live Long and Prosper \\//
BS"D
:
after running a query from a form, by using a command button, is it possible
to return the result of the query to a textbox in the same form?
eg....in the form i need to enter the Qty then run a query to calculate the
TotalCosts. I want to show the TotalCost in a Textbox in the form.
thanks!
Dave