cricketbird
Registered User.
- Local time
- Today, 08:24
- Joined
- Jun 17, 2013
- Messages
- 118
Hi there. I'm looking for some vision help:
We sell "beads", and people can order them in almost any volume or weight unit they want - cups, drums, kg, lb, etc. For orders, cost, etc. it needs to stay in these units. However, internally, we track everything in grams, so I need ways to convert all of these units to grams for use in several reports. My main tables relevant to this are listed at the end.
On my report that displays everything in grams:
1) Items ordered by weight (lbs, kg, g) should look up a standard weight table and multiply by the appropriate conversion factor to g (1 kg = 1000 g, etc.).
2) Items ordered by volume (cups, barrels, liters, etc) should look up the item number in a table that lists the appropriate conversion factor FOR THAT ITEM. For example, 1 cup of blue beads might weigh 30 g, but 1 cup of red beads might weigh 150 g.
3) If the unit is not already in either table (perhaps we never weighed a barrel of red beads before), then it should prompt us to enter the missing value
I'm trying to figure out the best way to approach this. It seems like you need to do this with if/then/else statements, so then it would be in VBA, perhaps with DLookUp lines. Yet, it seems most DLookUps can be better done with SQL, and then I'm back to doing queries with this. I don't know how to get a query to refer to one table in some circumstances, and a different one in others.
Any thoughts?
Thank you,
CB
Tables:
PRODUCTSTBL
ProductID
ProductName
etc.
UNITTBL
UnitID
UnitName (g, kg, lbs, cups, quarts, etc.)
ConversionFactor (only for weights, not volumes)
PRODUCTWEIGHTTBL
WeightID
ProductID
UnitID
GmWeight (weight in g of 1 unit of the product)
We sell "beads", and people can order them in almost any volume or weight unit they want - cups, drums, kg, lb, etc. For orders, cost, etc. it needs to stay in these units. However, internally, we track everything in grams, so I need ways to convert all of these units to grams for use in several reports. My main tables relevant to this are listed at the end.
On my report that displays everything in grams:
1) Items ordered by weight (lbs, kg, g) should look up a standard weight table and multiply by the appropriate conversion factor to g (1 kg = 1000 g, etc.).
2) Items ordered by volume (cups, barrels, liters, etc) should look up the item number in a table that lists the appropriate conversion factor FOR THAT ITEM. For example, 1 cup of blue beads might weigh 30 g, but 1 cup of red beads might weigh 150 g.
3) If the unit is not already in either table (perhaps we never weighed a barrel of red beads before), then it should prompt us to enter the missing value
I'm trying to figure out the best way to approach this. It seems like you need to do this with if/then/else statements, so then it would be in VBA, perhaps with DLookUp lines. Yet, it seems most DLookUps can be better done with SQL, and then I'm back to doing queries with this. I don't know how to get a query to refer to one table in some circumstances, and a different one in others.
Any thoughts?
Thank you,
CB
Tables:
PRODUCTSTBL
ProductID
ProductName
etc.
UNITTBL
UnitID
UnitName (g, kg, lbs, cups, quarts, etc.)
ConversionFactor (only for weights, not volumes)
PRODUCTWEIGHTTBL
WeightID
ProductID
UnitID
GmWeight (weight in g of 1 unit of the product)