Pop up based on Date field

G

Guest

I need to track inventory to keep it fresh. I have a date field and an
"expiration date" field. I need a pop-up reminder for anyone that opens the
database and would like to base the pop-up on 30 or 60 days before the
expiration date.
 
G

Guest

You can do this in multiple ways. You could create a query that returns an
integer indicating the number of days between now and the expiration date on
your products. If this integer is <30 then the product will expire in less
then 30 days and so on.

The math to calculate the days could be something like

This SQL will produce a query that will only return records where the expiry
date is in 30 or less days

SELECT tblDate_TestExpiryDate.expirationDate,
DateDiff("d",[tblDate_TestExpiryDate]![expirationDate],Date()) AS ExpireInDays
FROM tblDate_TestExpiryDate
WHERE
(((DateDiff("d",[tblDate_TestExpiryDate]![expirationDate],Date()))>=-30));

The function you need to check help on is datediff

Create a form that is based on this query and then open this form every time
someone opens the application.

If your query has results, it will show all the items due to expire.

As I said, there are many, many ways to do this depending on your
application and you needs. Hopefully this info gets you thinking about an
option you have not tried yet.

HTH

Andre
 

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