Results 1 to 5 of 5
  1. #1
    sah is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    37

    Form filtered data sent to report with gantt chart for printing - Not Working

    Hi,
    I have some 5 fields in a form and the same in a report. Report has an additional gantt chart kind of thing.
    2 fields are start date and end date. Based on these 2 fields number of days is calculated and the chart is populated dynamically by detail_format event of report.
    when i filter the form and say preview report based on Me.Filter in where condition of opening report, it shows the filtered report but while printing the same it shows all records irrespective of the form filters.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The embedded macro must not be passing filter criteria to the report, although looks like it should. I don't use macros, only VBA. Try VBA with:
    DoCmd.OpenReport "rptProjectSchedule", acViewNormal, , Me.Filter
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sah is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    37
    Tried the same but it displays a blank page. I dont have an actual printer only a virtual one using pdflite.
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Okay, this is weird. I tried printing to a real printer and didn't work either.

    However, this did work:
    Code:
    Private Sub cmdPrintReportButton_Click()
        DoCmd.OpenReport "rptProjectSchedule", acViewPreview, , Me.Filter
        DoCmd.PrintOut
        DoCmd.Close acReport, "rptProjectSchedule"
    End Sub
    The report printout is cut off on the left side.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    sah is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    37
    Thanks June7,
    This really solved my problem.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 07-28-2014, 01:15 PM
  2. MS Access GANTT Chart report
    By GaryElwood in forum Reports
    Replies: 8
    Last Post: 04-03-2012, 11:55 AM
  3. Report based of filtered data from a form
    By Fabdav in forum Reports
    Replies: 1
    Last Post: 09-15-2011, 05:28 AM
  4. Replies: 0
    Last Post: 12-20-2010, 12:35 PM
  5. Printing a report based on one row of data
    By MEEMeyer in forum Reports
    Replies: 8
    Last Post: 03-04-2010, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums