Adding and subtracting Dates

  • Thread starter Thread starter Kevin Kleinholter
  • Start date Start date
K

Kevin Kleinholter

I am looking to have a message box pop up a few days before somthing is
due. If on my form I have a date box that has the due date in it, how
would i subrtract two days from that or add two days to todays date?
Example: if Date() + 2 = txtDueDate then
msgbox "Message"
end if
or
if txtDuedate - 2 = Date() then
msgbox "Message"
end if

If todays date plus 2 days equals the date in txtDueDate then show a
message box.
If txtDueDate minus 2 days equals todays date then show a message box

If anyones knows how I would write this code, please help me out.

Thanks,

Kevin
 
If Date = DateAdd("d", -2, Me.txtDueDate) Then
MsgBox "Message"
End If

In case someone wasn't there 2 days before, you may want to pop-up the message one day
before also.
 
Back
Top