A
a3c05776
Thanks in advance to any help with this
I have a simple mdb project for a shopping list (I'm using this as a
learning experience)
In the project I have a tables for Items, Item Versions and Pricing.
ITEMS Table:
ID_ITEM (autonumber - primary key)
Item Name (text)
ITEM VERSIONS table:
ID_ITEM_VERSION (autonumber - primary key)
ID_ITEM (foreign key to ITEMS table)
Size (long integer)
Size Unit (text)
PRICING table:
ID_PRICING (autonumber - primary key)
Store Name (text)
Price (currency)
Date (date)
Cost Per Unit (number)
The tables are set up with a relationship such that after entering a
new item (Milk) I can then add several 'versions' or sizes, brands,
flavours, etc. For example, I might have Milk with three entries, 1
Gal 2%, 1 Gal Skim and 1 Gal Chocolate.
Then for each 'version' of an item, I have the various prices from
each store.
This should enable me to compare prices for the same size, weight,
qty, etc of various items across various stores.
My challenge:
What I am having trouble with is creating a form or update query so
that when I enter the price for an item version in the pricing table,
the Cost Per Unit updates. The calculation is simple; Price / Size.
I'm having difficulty understanding how to create the code, macro or
update query (whichever it is that I need) to take the information
from two different tables (the size from the ITEM_VERSION table and
the price from the PRICING table) and updating the Cost Per Unit in
the PRICING table.
I'd like it to post the calculation into the PRICING table updating
the CPU field, so that I can use that data in reports, exports to
Excel and so on.
Once I have this done, I should be able to compare prices for various
sizes of items based upon their cost per unit. Essentially, I'm
trying to create a way to cost compare apples to apples (pun
intended!)
I can send the mdb file to anyone who is willing to help out.
Thanks!
I have a simple mdb project for a shopping list (I'm using this as a
learning experience)
In the project I have a tables for Items, Item Versions and Pricing.
ITEMS Table:
ID_ITEM (autonumber - primary key)
Item Name (text)
ITEM VERSIONS table:
ID_ITEM_VERSION (autonumber - primary key)
ID_ITEM (foreign key to ITEMS table)
Size (long integer)
Size Unit (text)
PRICING table:
ID_PRICING (autonumber - primary key)
Store Name (text)
Price (currency)
Date (date)
Cost Per Unit (number)
The tables are set up with a relationship such that after entering a
new item (Milk) I can then add several 'versions' or sizes, brands,
flavours, etc. For example, I might have Milk with three entries, 1
Gal 2%, 1 Gal Skim and 1 Gal Chocolate.
Then for each 'version' of an item, I have the various prices from
each store.
This should enable me to compare prices for the same size, weight,
qty, etc of various items across various stores.
My challenge:
What I am having trouble with is creating a form or update query so
that when I enter the price for an item version in the pricing table,
the Cost Per Unit updates. The calculation is simple; Price / Size.
I'm having difficulty understanding how to create the code, macro or
update query (whichever it is that I need) to take the information
from two different tables (the size from the ITEM_VERSION table and
the price from the PRICING table) and updating the Cost Per Unit in
the PRICING table.
I'd like it to post the calculation into the PRICING table updating
the CPU field, so that I can use that data in reports, exports to
Excel and so on.
Once I have this done, I should be able to compare prices for various
sizes of items based upon their cost per unit. Essentially, I'm
trying to create a way to cost compare apples to apples (pun
intended!)
I can send the mdb file to anyone who is willing to help out.
Thanks!