MS Access VBA Stop Function that sends email based on value of form textbox.

MS Access VBA Stop Function that sends email based on value of form textbox.  I want it to send out the email based on the first time the value exceeds 10 but not after that when additional records are added for the same date.  How can I do this?
deer777Asked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
You'd have to store whether or not the email has been sent. Without knowing any more details it's hard to give you good advice, but essentially you'd either add a "flag" field to the table, or use a separate table to store when an email is sent.

For example, if I have an Invoice table like this:

tInvoice_Header
ID
Invoice
Customer
etc

And I want to know if I've sent an email to that customer, I could add a new field to the table:

Email_Sent (boolean)

I'd then set that to True when I send the email. Afterwards, I can check that field to determine if I need to send an email.

Often, however, you may need to send multiple emails for the same item. For example, you may need to send an email containing the invoice at creation. YOu may also need to send followup emails if the invoices is unpaid after 30 days, again at 60 days, and so forth. In cases like this you'd need a table to store when those different emails are sent:

tEmail_Alerts
-----------------
ID
Item_Type (Invoice, or perhaps PO, etc)
Item_ID << the Primary Key value of the item
Alert_Type << eg Invoice_Sent, 30_Day_Notice
Alert_Date
Alert_Sent_To
etc etc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.