Results 1 to 4 of 4
  1. #1
    nashie is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    1

    Warning showing a date will expire in 30 days.

    I am trying to create some sort of warning to show that a date in one of my forms will expire in say 30 days. I need the warning to be a pop up (or similar) rather than be sent via email (only because I don't have Outlook set up and probably will not be able to). Effectively, I have a list of names and a column in my table to show an expiry date. To avoid missing the expiry date, I would like to be advised of this at least 30 days before hand. Thanks in advance.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Assuming your Expiry date is ExpiryDate, this should give a list of records whose ExpiryDate is less than or equal to 30 days from Today's date. (untested)

    see here for more info

    Select * from YourTable
    WHERE
    DateDiff("d",ExpiryDate, Date()) <=30;

  3. #3
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    I would probably put something like this on the OnCurrent of the form. Then whenever you navigate to a record that meets the criteria a message box will pop up.

    Code:
    If Datediff("d",date(),Me!DATEFIELD) <= 30 then
     Msgbox "WARNING....YOUR MESSAGE TEXT GOES HERE..."
    End If
    I would probalby create a report though that listed all records that were about to expire and then run it daily. This way nothing would get missed.

    NB: You need to replace DATEFIELD with the actual name of your date field.

  4. #4
    HMEpartsmanager is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    85
    Quote Originally Posted by nashie View Post
    I am trying to create some sort of warning to show that a date in one of my forms will expire in say 30 days. I need the warning to be a pop up (or similar) rather than be sent via email (only because I don't have Outlook set up and probably will not be able to). Effectively, I have a list of names and a column in my table to show an expiry date. To avoid missing the expiry date, I would like to be advised of this at least 30 days before hand. Thanks in advance.
    I have an A/P Form, that I put this code in the OnTimer event for the main form.


    If [ordDate] < (Date - 45) Then
    If [ordDate].ForeColor = vbBlack Then
    [ordDate].ForeColor = vbRed
    Else
    [ordDate].ForeColor = vbBlack
    End If
    '
    Else
    [ordDate].ForeColor = vbBlack
    '
    End If

    Basically this form has the original date showing on the form, and if I navigate to a record that is 45 days old, this field will continually flash at me indicating it is old.

    That is how I do it on a form that works for my purposes.

    Tim

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-12-2013, 03:48 AM
  2. Replies: 7
    Last Post: 01-28-2013, 05:21 PM
  3. Replies: 3
    Last Post: 11-20-2012, 01:40 PM
  4. Showing Graph of Prior Days Downtime
    By MFS in forum Forms
    Replies: 4
    Last Post: 03-28-2012, 05:11 AM
  5. Replies: 3
    Last Post: 02-24-2012, 01:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums