Popup reminder in a form

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
 
K

Keith Wilby

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
 
G

Gator

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 ?
 
G

Gator

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?
 
J

JeanetteJH

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.
 
K

Keith Wilby

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top