Solved

how to send notification when inventory level is below minimum?

Posted on 2004-04-02
3
323 Views
Last Modified: 2006-11-17
I want to realize this function: whenever the inventory quantity for a specific item is below certain level, It will automatically send notifications to me. In my inventory table, there are "total quantity" field and "minimum quantity" field. I created a form, I hope this could work right after I update the quantity for this item, and close the form. Could anyone here help me out on this?

Thanks a lot!
0
Comment
Question by:cuc357
3 Comments
 
LVL 1

Accepted Solution

by:
John_Crumley earned 125 total points
Comment Utility
Hello!

In the "Form_AfterUpdate" event, add some code similiar to the following skeleton...


Dim subject As String
Dim message As String
Dim toemail As String
   
If me.totalquantity < me.minimumquantity then

    toemail = "you@somewhere.com"
    subject = "Low inventory warning:  " & Me.partnumber
    message = Now & vbCrLf
    message = message & "The stock level for " & Me.partnumber & " has dropped below " & Me.minimumquantity & "." & vbCrLf
    message = message & "The current stock level is " & Me.totalquantity & "."
   
    DoCmd.SendObject acSendNoObject, , acFormatTXT, toemail, , , subject, message, False

End if


This should send an email to the address (or addresses) you specify when the level drops below the minimum.  You may need to adjust the settings on your email client to allow another program to send an email without confirmation.

Hope this helps,

John
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now