PDA

View Full Version : Help with simple inventory function



mhass33
04-19-2009, 08:38 PM
I'm doing a simple project where I have an inventory database in Access and I want to program it in VBA to give a warning message whenever the inventory quantity is at a certain level. Anyone wanna help me out? I have no VBA experience but I did a little with VB studio a few years ago. I imagine the code is quite brief but I dont even know how to start

OBP
04-20-2009, 04:02 AM
Assuming someone is going to enter the value in an Inventory "Stock" field you would use

if me.fieldname =< minimumvalue then msgbox "Re-order now"

where fieldname is the actual name of your field, (the VBA Editor provides a list in a drop down) and the minimumvalue is either a "hard coded" variable or better still another field which holds the minimum value for each product.
In which case use
if me.fieldname =< me.minimumvaluefieldname then msgbox "Re-order now"

ps The me. is shorthand for the Currently Active Form's name.