In an earlier post, you helped me format the output of a (US) date picker into UK format using ...
At that time I was using the date picker to select 2 dates and testing that one was after the other when the user tried to save the userform ...
This time I am setting one date field using ...
But when I test as follows ...
Unless the dd value (irrespective of mm) of NextActionDate is >= to the dd value of ReportedDate my MsgBox appears ...
Any ideas please?
VBA Code:
Private Sub cmdNextActionDate_Click()
Dim dateVariable As Date
dateVariable = CalendarForm.GetDate
If dateVariable <> 0 Then
Me.txtNextActionDate.Text = Format(CLng(dateVariable), "dd/mm/yyyy")
End If
End Sub
At that time I was using the date picker to select 2 dates and testing that one was after the other when the user tried to save the userform ...
This time I am setting one date field using ...
Code:
txtReportedDate.value = Format(Date, "dd/mm/yyyy")
But when I test as follows ...
Code:
If txtNextActionDate < txtReportedDate Then
MsgBox "Next Action Date must be after the Reported Date (today), please correct and Save again"
Exit Sub
End If
Unless the dd value (irrespective of mm) of NextActionDate is >= to the dd value of ReportedDate my MsgBox appears ...
Any ideas please?