View Full Version : Progress Meter for Inventory


wizcow
11-17-2001, 06:43 AM
Hi

my inventory page text box, 'items' shows how many items are left in stock.

i would like to have a progress meter instead.
eg. if there should be 50 items in stock and there are only 25 left. the progress meter will be half full.

how do i do this?
Thanks
Tom

Fornatian
11-18-2001, 10:19 AM
Assuming you have two values available(the stock item and the 'should have' level then I would use two boxes, of different colour the first one(grey,) would be a static size say 5cm wide. The second would be your stock level:

In the OnCurrent event of your form and other events you could put the following code to resize the box.

Dim lngStockLeft as Long
'establish the percentage of stock you have left
lngStockLeft = Me!StockLevel/Me.ShouldHave
'set the boxes width to the percentage * the width of the static box.
Me.BoxMeter.Width = Me.StaticBox * lngStockLeft

Additionally, you could have a re-order level included as follows:

If Me.StockLevel <= Me.ReorderLevel then
Me.BoxMeter.BackColor = 255 'red
Else
Me.BoxMeter.BackColor = 8838608 'dark blue
end if

HTH

Ian

wizcow
11-18-2001, 11:42 PM
Thanks Ian!

Tom