I have the following code
if NewInvoiceDate = 30/3/2013 and date = 19/3/2013 (today's date) the code:
"If NewInvoiceDate > DateAdd("d", 2, Date)" returns false. The code goes straight to "End If"
What is wrong with my code?
Many thanks
Code:
Dim NewInvoiceDate as date
If NewInvoiceDate > DateAdd("d", 2, Date) Then
Do Until IsDate(NewInvoiceDate) And NewInvoiceDate < DateAdd("d", 2, Date)
NewInvoiceDate = InputBox("The invoice date is greater than 21 days from today.
Please enter a new invoice date.", "New Invoice Date Required", Date)
Loop
End If
"If NewInvoiceDate > DateAdd("d", 2, Date)" returns false. The code goes straight to "End If"
What is wrong with my code?
Many thanks