Hi
I'm new to Visual basic.
I'm getting an runtime error 424:object not found,When i'm validating between dates in crystal reports.Please correct me where i did wrong..
Private Sub Command1_Click()
Dim f_date As Date
Dim t_date As Date
'From_Date and To_Date Validation
f_date = Trim(Format(DTPicker1.Day, "00")) + "/" + Trim(Format(DTPicker1.Month, "00")) + "/" + Trim(Format(DTPicker1.Year, "00"))
t_date = Trim(Format(DTPicker2.Day, "00")) + "/" + Trim(Format(DTPicker2.Month, "00")) + "/" + Trim(Format(DTPicker2.Year, "00"))
If (Mid(t_date, 4, 2) < Mid(f_date, 4, 2)) Then
MsgBox ("Please check the Date/Month entry")
Exit Sub
End If
If ((Mid(t_date, 4, 2) = Mid(f_date, 4, 2)) And (Mid(t_date, 1, 2) < Mid(f_date, 1, 2))) Then
MsgBox ("Please check the Date/Month entry")
Exit Sub
End If
'End of From_Date and To_Date Validation
CrystalReport1.ReportFileName = "Y:\XYZ\ESJuly\vipf.rpt"
CrystalReport1.RecordSelectionFormula = "{Phase_VIPF.Phase_vipf.date}=> ' " & DTPicker1.Value.Tostring("dd/MM/yyyy") & " '" and {Phase_VIPF.Phase_VIPF.date}<= ' " & DTPicker2.Value.Tostring("mm/dd/yyyy") & " '"
CrystalReport1.Action = 1
End Sub