Another Date ?

K

Keypad

Ken,

Here are the dates I tried, each being in a different record. The count
starts again for 7 days after expiration date. Is it possible to have the
message continue to say "Membership Expired" for all subsequent days after
initial expiration until the void date is changed. Other than that, it works
perfectly.

5/19/2008 = Expires in 7 days
5/20/2008 = Expires in 6 days
5/21/2008 = Expires in 5 days
5/22/2008 = Expires in 4 days
5/23/2008 = Expires in 3 days
5/24/2008 = Expires in 2 days
5/25/2008 = Expires in 1 day
5/26/2008 = Membership Expired
5/27/2008 = Expires in 1 day
5/28/2008 = Expires in 2 days
5/29/2008 = Expires in 3 days
5/30/2008 = Expires in 4 days
5/31/2008 = Expires in 5 days
6/1/2008 = Expires in 6 days
6/2/2008 = Expires in 7 days
6/3/2008 = No more messages after this date.
 
K

Ken Snell [MVP]

Yes. This code should do what you want:

Private Sub Form_Current()

Dim lngDays As Long
lngDays = DateDiff("d", Date, DateAdd("yyyy", 1, Me.txtVoid))

Debug.Print lngDays

Select Case lngDays
Case 1 To 7
MsgBox "Your membership will expire in " & _
lngDays & " day" & _
IIf(lngDays = 1, "", "s"), _
vbOK, "Membership Is Expiring"

Case Is <= 0
MsgBox "Membership Expired", vbOK, _
"Expired Membership"
End Select

End Sub

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 

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