Select Price using check box

G

Guest

I have a project based on the Northwinds Traders sample database. On the
Invoice header (Orders Table) I would like to put check boxes for selecting
a price field. Price A and Price B.
On my “Orders Details†Subform Items from my “Products†table are entered. I
will have two prices for each item in the product table. “Price A & Price B
One of these prices will be inserted into the “UnitPrice†on the Orders
Details form. Currently I am using the DLookUp: Me!UnitPrice =
DLookup("UnitPrice", "Products", strFilter) to insert the UnitPrice price
from the Products table. This part works fine. From then on I am brain dead.
So….How do I filter the selection for price A or B. Once again thanks for
your help.
 
G

Guest

Me!UnitPrice = DLookup("UnitPrice", "Products", strFilter)

I don't know all the details, but something like this might work. I would
put the check boxes in an Option Group so only one could be checked, or there
will be problems. In fact, I only use check boxes as stand alone controls.
When I am using and Option Group, I use Radio Buttons. This avoids confusing
users (which is not all that hard :)) Anyway, where you current Dlookup is,
and assuming that Prices A and B are in the Products table, see if this is of
any value to you:
Assume the option group is opgPriceAB and it returns 1 for A and 2 for B
Dim strPriceField as String

strPriceField = Iif(Me.opgPriceAB = 1,"UnitPriceA","UnitPriceB")
Me!UnitPrice = DLookup(strPriceField, "Products", strFilter)
 

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