G
Guest
This is the code that compares the two dates
If (CalendarDate1 >= CalendarDate2) Then
MsgBox "Please enter the correct date range", vbOKOnly + vbExclamation,
"SASMonitor"
Exit Sub
End If
The below code is where i get the date from the user.i have two calendar
components in my form.that's why two calendar
Private Sub Calendar1_Click()
CalendarDate1 = Trim(Format(Calendar1.Value, "dd-mm-yy"))
Command1.Enabled = False
MsgBox CalendarDate1
End Sub
Private Sub Calendar2_Click()
CalendarDate2 = Trim(Format(Calendar2.Value, "dd-mm-yy"))
Command1.Enabled = False
Command3.SetFocus
MsgBox CalendarDate2
End Sub
'when i do this i am not able to get the correct comparison.the case is when
i select 10th may 2004 from the first calendar and 1st june 2004 from the
second calendar,it says that 10th may 2004 is greater.pls help me.
Thanks in advance.
If (CalendarDate1 >= CalendarDate2) Then
MsgBox "Please enter the correct date range", vbOKOnly + vbExclamation,
"SASMonitor"
Exit Sub
End If
The below code is where i get the date from the user.i have two calendar
components in my form.that's why two calendar
Private Sub Calendar1_Click()
CalendarDate1 = Trim(Format(Calendar1.Value, "dd-mm-yy"))
Command1.Enabled = False
MsgBox CalendarDate1
End Sub
Private Sub Calendar2_Click()
CalendarDate2 = Trim(Format(Calendar2.Value, "dd-mm-yy"))
Command1.Enabled = False
Command3.SetFocus
MsgBox CalendarDate2
End Sub
'when i do this i am not able to get the correct comparison.the case is when
i select 10th may 2004 from the first calendar and 1st june 2004 from the
second calendar,it says that 10th may 2004 is greater.pls help me.
Thanks in advance.