Here's an example let's say you have the following tables:
Code:
tblCustomerType
TypeID TypeDesc
1 A
2 B
tblCustomers
CustomerID CustomerName TypeID ----> other customer related fields
1 Acompany Inc 1
2 Bcompany Mfg 2
tblParts
PartID ListA ListB
1 10.00 8.00
2 20.00 17.00
3 5.00 3.50
Now let's say you have a table for your orders and line items:
Code:
tblOrders
OrderID CustomerID -----> other order related data
1 2
2 2
3 1
tblOrderDetail
DetailID OrderID PartID Qty
1 1 1 2
2 1 2 5
3 1 3 10
When you are creating your invoice in a query you can link your DETAIL to your ORDER to your CUSTOMER to your CUSTOMER TYPE table
then have this formula in your query:
LineItemCost: iif(customertype = 1, ListA, ListB) * qty
So, on your first line item you have 2 items of part number 1, when you link back to the orders, then the customers (in this case I used the PK but it might be easier if you backtrack it all the way to the label which means adding the customer type table) you'll see that they are listed as a TYPE A customer so the query should take the value of the LISTA column and multiply it by your quantity to get 20$ total cost.