K
Kenny Kepler
Hello,
I have a DB for tracking orders that I have created in Access 2003. I have
been asked to create a profile for customers that contains all their details
and the products they buy from us. We sell the same products at different
prices to our various cutomers. For example:
Product A:
$10.00 for Customer A
$9.50 for Customer B
$11.05 for Customer C
Product B:
$5.95 for Customer A
$6.95 for Customer B
$6.45 for Customer C
This pricing information is to be included in their profile. I have
achieved this by creating a separate table called price_by_cust and set two
fields as the primary key (multiple-field primary key); the cust_id and the
prod_id fields. The only other field in that table is the price field. In
the relationships window I joined the primary key of the customer table
(cust_id) and the primary key of the products table (prod_id) to the
corresponding fields in the price_by_cust table. Using those two tables I
created a query that would return all the product information and the
pricing information of products by customer and used that query for a
subform in the form created for entering customer details (address, customer
ID, etc,), and it works really well.
Now when it comes to raising an order for a cutomer I have added a subform
to the orders table for adding products. When I add products to the subform
the price should default to that customers price. This would be easy but I
have been told that the price can change, for whatever reason, but it
shouldn't change the customers "guide price" in their profile. So if I add
Product A to an order for Cutomer B but I am now selling it at $8 per unit
because they bought in bulk I should be able to amend the defaulted price on
the order without affecting the price in the prcie_by_cust table.
Basically, how do I get Access to use a vale in a field in another table to
set the default for a field in the active table based on two criteria -
cust_id and prod_id?
Please help, I have come so far with this and I don't want to be defeated by
something that seems like it should be simple.
Thank you,
Kenny Kepler
I have a DB for tracking orders that I have created in Access 2003. I have
been asked to create a profile for customers that contains all their details
and the products they buy from us. We sell the same products at different
prices to our various cutomers. For example:
Product A:
$10.00 for Customer A
$9.50 for Customer B
$11.05 for Customer C
Product B:
$5.95 for Customer A
$6.95 for Customer B
$6.45 for Customer C
This pricing information is to be included in their profile. I have
achieved this by creating a separate table called price_by_cust and set two
fields as the primary key (multiple-field primary key); the cust_id and the
prod_id fields. The only other field in that table is the price field. In
the relationships window I joined the primary key of the customer table
(cust_id) and the primary key of the products table (prod_id) to the
corresponding fields in the price_by_cust table. Using those two tables I
created a query that would return all the product information and the
pricing information of products by customer and used that query for a
subform in the form created for entering customer details (address, customer
ID, etc,), and it works really well.
Now when it comes to raising an order for a cutomer I have added a subform
to the orders table for adding products. When I add products to the subform
the price should default to that customers price. This would be easy but I
have been told that the price can change, for whatever reason, but it
shouldn't change the customers "guide price" in their profile. So if I add
Product A to an order for Cutomer B but I am now selling it at $8 per unit
because they bought in bulk I should be able to amend the defaulted price on
the order without affecting the price in the prcie_by_cust table.
Basically, how do I get Access to use a vale in a field in another table to
set the default for a field in the active table based on two criteria -
cust_id and prod_id?
Please help, I have come so far with this and I don't want to be defeated by
something that seems like it should be simple.
Thank you,
Kenny Kepler