Results 1 to 4 of 4

Thread: Date Range Report Need Help

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    1

    Exclamation Date Range Report Need Help

    What is wrong???
    I want to create date range and send it to cr10 but nothing happen ??

    pls help....
    vb Code:
    1. Private Sub Form_Load()
    2. DTPicker1.Value = Format$(Date, "dd/mm/yyyy")
    3. DTPicker2.Value = Format$(Date, "dd/mm/yyyy")
    4. END SUB
    5.  
    6. Private Sub Command1_Click()
    7. On Error GoTo Err
    8. Dim DTR as String
    9. Dim DRR as String
    10. d= Mid(DTPicker1, 1, 2)
    11. m = Mid(DTPicker1, 4, 2)
    12. Y = Mid(DTPicker1, 7, 4)
    13. DTR = m & "/" & d & "/" & Y
    14. DTR = Format(DTR, "dd/mm/yyyy")
    15. d = Mid(DTPicker2, 1, 2)
    16. m = Mid(DTPicker2, 4, 2)
    17. Y = Mid(DTPicker2, 7, 4)
    18. DRR = m & "/" & d & "/" & Y
    19. DRR = Format(DRR, "dd/mm/yyyy")
    20. With CrystalReport1
    21. .ReportFileName = App.Path & "\Report.rpt" 'Report File Name
    22. .DataFiles(0) = App.Path & "\MyData.mdb" ' Set Table Path in Report
    23. 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 & ""
    24. .SelectionFormula = txtFormula
    25. .WindowState = crptMaximized ' Show Maximized Report
    26. .PrintReport ' Show Report
    27. End With
    28. End If
    29. Exit Sub
    30. Err:
    31. MsgBox Err.Description
    32. End Sub
    Last edited by Hack; Feb 19th, 2008 at 09:19 AM. Reason: Added highlight tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width