Popup reminder in a form

  • Thread starter Thread starter JeanetteJH
  • Start date Start date
J

JeanetteJH

I have an Inventory Database and I want to be able to warn the user that
certain inventory items have a minimum qty to purchase. On a Purchase Order
form, I would like this to appear in a message box when the user enters a qty
that is less than the minimum needed. Is this possible? If so, can someone
point me in the right direction?

Thank you for any assistance.

Jeanette
 
JeanetteJH said:
I have an Inventory Database and I want to be able to warn the user that
certain inventory items have a minimum qty to purchase. On a Purchase
Order
form, I would like this to appear in a message box when the user enters a
qty
that is less than the minimum needed. Is this possible? If so, can
someone
point me in the right direction?

Thank you for any assistance.

Jeanette

You would need to store the minimum quantity somewhere so I'll assume that
you're storing it in a table. I'll also assume you have some code to gather
the user-entered quantity ("intQuantity"). In your code, use the DLookup
function:

If intQuantity < DLookup("fldMin","tblMyTable","MyCriteria") Then
MsgBox "The Quantity entered is lower than the permitted minimum."
Cancel = True
'Do other stuff
End If

Keith.
www.keithwilby.co.uk
 
could you elaborate on "MyCriteria"....My question is if you have a inventory
table with a field of minQtyOrder and a form displaying orders with a
qtyOrdered field....how could you compare the qtyOrdered with the
minQtyOrder? Is this an array issue or Case Select ?
 
Are your inventory items associated in groups or categories?
How many inventory items are there?
How many groups / categories are there?
Are you using listboxes or comboboxes to select an inventory item?
 
No they are not associated in groups although there is a category involved
with each part and there are at this time about 350 items. I am using a
combobox to select the inventory item. The DLookup statement worked fine
with a little modifications.
 
Gator said:
could you elaborate on "MyCriteria"....My question is if you have a
inventory
table with a field of minQtyOrder and a form displaying orders with a
qtyOrdered field....how could you compare the qtyOrdered with the
minQtyOrder? Is this an array issue or Case Select ?

"MyCriteria" would be the criteria required to select the minimum quantity
value from the table or query defined by "tblMyTable".

Keith.
 
Back
Top