Date Range Report Need Help
What is wrong???
I want to create date range and send it to cr10 but nothing happen ??
pls help....:eek2:
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
Re: Date Range Report Need Help
I guess I would try it without the selection criteria and make sure it works. If so, I would start adding the selection back in until it quit working. That would be the problem area.
Re: Date Range Report Need Help
Welcome ce77en :wave: :afrog:
pls indent your code & post it using Code or VBCode Tags
Re: Date Range Report Need Help
Welcome to the forums. :wave:
Quote:
Originally Posted by Pasvorto
I guess I would try it without the selection criteria and make sure it works. If so, I would start adding the selection back in until it quit working. That would be the problem area.
Did you try this? Are you still having your problem?