Hi everyone,
I am using Allen Browne's Inventory Control Quantity on Hand code and it has an optional vAsOfDate variant, as shown in the code below. I would like to use this to show the quantity on hand for a specific date but I can't get it working. I am currently using the code based on the most recent stocktake date and it works beautifully, however I would like to expand on this to be able to compare quantity on hand levels at a specific date to the latest stocktake quantity on hand level and then find the difference. How can I achieve this?
I can post the code in full if you need it but it's quite long so thought I'd just include the first few lines showing the optional variant for now.
Thanks for your help.
Chris
I am using Allen Browne's Inventory Control Quantity on Hand code and it has an optional vAsOfDate variant, as shown in the code below. I would like to use this to show the quantity on hand for a specific date but I can't get it working. I am currently using the code based on the most recent stocktake date and it works beautifully, however I would like to expand on this to be able to compare quantity on hand levels at a specific date to the latest stocktake quantity on hand level and then find the difference. How can I achieve this?
Code:
Public Function OnHand(vProduct_Code As Variant, Optional vAsOfDate As Variant) As Long
'Purpose: Return the quantity-on-hand for a product.
'Arguments: vProduct_Code = the product to report on.
' vAsOfDate = the date at which quantity is to be calculated.
' If missing, all transactions are included.
'Return: Quantity on hand. Zero on error.
I can post the code in full if you need it but it's quite long so thought I'd just include the first few lines showing the optional variant for now.
Thanks for your help.
Chris
Last edited: