peskywinnets
Registered User.
- Local time
- Today, 06:18
- Joined
- Feb 4, 2014
- Messages
- 582
Inventory control (modifying Allen Browne's procedure
So I need to track inventory, a bit of googling reveals this...
http://allenbrowne.com/appinventory.html
which is fine (it works well) ....but it only works if there's been at least one sale for each product being queried (i.e. there must be an entry in InvoiceDetail table for the product)....that's no good, because when you first stock a new item, you've not made any sales for that product, so his 'Quantity On Hand' code won't work in that instance ....unless I'm missing something obvious?
So I think the code needs tweaking, but I need some guidance on how...I reckon it's failing because of the relationships.....

...I'm thinking that unless there's an entry for the productID in the 4 rightmost tables then the product won't show when passing to his function - but I could be wrong! Is there a way of spoofing (or working around) for the situation I mention (new product just in, no customer sales yet)
So I need to track inventory, a bit of googling reveals this...
http://allenbrowne.com/appinventory.html
which is fine (it works well) ....but it only works if there's been at least one sale for each product being queried (i.e. there must be an entry in InvoiceDetail table for the product)....that's no good, because when you first stock a new item, you've not made any sales for that product, so his 'Quantity On Hand' code won't work in that instance ....unless I'm missing something obvious?
So I think the code needs tweaking, but I need some guidance on how...I reckon it's failing because of the relationships.....

...I'm thinking that unless there's an entry for the productID in the 4 rightmost tables then the product won't show when passing to his function - but I could be wrong! Is there a way of spoofing (or working around) for the situation I mention (new product just in, no customer sales yet)
Last edited:
