What is wrong???
I want to create date range and send it to cr10 but nothing happen ??
pls help....![]()
vb Code:
Private Sub Form_Load() DTPicker1.Value = Format$(Date, "dd/mm/yyyy") DTPicker2.Value = Format$(Date, "dd/mm/yyyy") END SUB Private Sub Command1_Click() On Error GoTo Err Dim DTR as String Dim DRR as String d= Mid(DTPicker1, 1, 2) m = Mid(DTPicker1, 4, 2) Y = Mid(DTPicker1, 7, 4) DTR = m & "/" & d & "/" & Y DTR = Format(DTR, "dd/mm/yyyy") d = Mid(DTPicker2, 1, 2) m = Mid(DTPicker2, 4, 2) Y = Mid(DTPicker2, 7, 4) DRR = m & "/" & d & "/" & Y DRR = Format(DRR, "dd/mm/yyyy") With CrystalReport1 .ReportFileName = App.Path & "\Report.rpt" 'Report File Name .DataFiles(0) = App.Path & "\MyData.mdb" ' Set Table Path in Report txtFormula = "{internal_trans.tdate}>=#" & DTR & "# and {internal_trans.tdate}<=#" & DRR & "# AND {internal_trans.destination_branch}= '" & combo1 & "'and {internal_trans.M_curr} = '" & combo2 & "' and {internal_trans.branch}= '" & combo3 & "'and {internal_trans.typ_no} = " & Text1 & "" .SelectionFormula = txtFormula .WindowState = crptMaximized ' Show Maximized Report .PrintReport ' Show Report End With End If Exit Sub Err: MsgBox Err.Description End Sub


Reply With Quote

