Results 1 to 4 of 4

Thread: Date Range Report Need Help

  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

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  3. #3
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Date Range Report Need Help

    Welcome ce77en
    pls indent your code & post it using Code or VBCode Tags

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Date Range Report Need Help

    Welcome to the forums.
    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?

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