B
Bob Anderson
Earlier I posted Inventory Assembly/Sub-component question:
I'm going to use a McDonald's analogy of my problem because it's familiar. I
can easily inventory the comings and goings of my inventory items. I make a
Big Mac and it is added to the inventory total. I sell a Big Mac and it is
deleted from the inventory total. I can easily enough inventory the comings
and goings of Big Mac meals too (exactly the same way as anything else).
What I can't see how to do is correctly handle the sale of a Big Mac Meal.
How do I automatically deduct one Big Mac, one fries and one drink (and the
Meal) every time I sell a Big Mac Meal? By the way, I am working in Access
97 with a database created by the Database Wizard for Inventory Control.
I'm still using Access 97. I still have a problem of getting the correct
inventory count, although I have a better understanding of the problem. I
have a query that will show me two records. The numbers, if I could only add
them together, would give the desired result. Here is that query:
SELECT ItemsForSale.ItemForSaleID, ItemsForSale.ItemName,
Sum((nz([UnitsReceived])-nz([UnitsSold])-nz([UnitsShrinkage]))) AS [Units in
Stock], Sum((nz([UnitsOrdered])-nz([UnitsReceived]))) AS [Units on Order],
Products.ProductID
FROM Products INNER JOIN ((ItemsForSale INNER JOIN Assemblies ON
ItemsForSale.ItemForSaleID = Assemblies.ItemForSaleID) INNER JOIN [Inventory
Transactions] ON ItemsForSale.ItemForSaleID = [Inventory
Transactions].ItemForSaleID) ON Products.ProductID = Assemblies.ProductID
GROUP BY ItemsForSale.ItemForSaleID, ItemsForSale.ItemName,
Products.ProductID
HAVING (((Products.ProductID)=[Enter ItemForSaleID]))
ORDER BY Products.ProductID;
I thought I could write a sub or function that would allow me to "get" the
two numbers and add them. But, when I use the SQL text from my working query
(strSQL= my pasted text) VB is rejecting it saying; "Compile error: Expected
end of statement". Is this enough information? Can anyone help with an idea
out of this mess?
I'm going to use a McDonald's analogy of my problem because it's familiar. I
can easily inventory the comings and goings of my inventory items. I make a
Big Mac and it is added to the inventory total. I sell a Big Mac and it is
deleted from the inventory total. I can easily enough inventory the comings
and goings of Big Mac meals too (exactly the same way as anything else).
What I can't see how to do is correctly handle the sale of a Big Mac Meal.
How do I automatically deduct one Big Mac, one fries and one drink (and the
Meal) every time I sell a Big Mac Meal? By the way, I am working in Access
97 with a database created by the Database Wizard for Inventory Control.
I'm still using Access 97. I still have a problem of getting the correct
inventory count, although I have a better understanding of the problem. I
have a query that will show me two records. The numbers, if I could only add
them together, would give the desired result. Here is that query:
SELECT ItemsForSale.ItemForSaleID, ItemsForSale.ItemName,
Sum((nz([UnitsReceived])-nz([UnitsSold])-nz([UnitsShrinkage]))) AS [Units in
Stock], Sum((nz([UnitsOrdered])-nz([UnitsReceived]))) AS [Units on Order],
Products.ProductID
FROM Products INNER JOIN ((ItemsForSale INNER JOIN Assemblies ON
ItemsForSale.ItemForSaleID = Assemblies.ItemForSaleID) INNER JOIN [Inventory
Transactions] ON ItemsForSale.ItemForSaleID = [Inventory
Transactions].ItemForSaleID) ON Products.ProductID = Assemblies.ProductID
GROUP BY ItemsForSale.ItemForSaleID, ItemsForSale.ItemName,
Products.ProductID
HAVING (((Products.ProductID)=[Enter ItemForSaleID]))
ORDER BY Products.ProductID;
I thought I could write a sub or function that would allow me to "get" the
two numbers and add them. But, when I use the SQL text from my working query
(strSQL= my pasted text) VB is rejecting it saying; "Compile error: Expected
end of statement". Is this enough information? Can anyone help with an idea
out of this mess?