Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    Tullahoma, Tennessee, USA
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print or Export the results of a Filter (not query

    Access 97

    I want to write VBA code for a "Print" button in a form that prints a report using only the currently displayed (filtered) data.

    I have a Form with buttons set up to allow the user to easily filter records. Once the user has filtered the records, I need to give them the option to print a report (and/or export) based on the filtered (not query criteria) data.

    I want the user to dynamically be able to use the user-friendly filtering tools rather than parameter queries.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    La Verne, California, USA
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print or Export the results of a Filter (not query

    You may want to look at the ACCESS MVP website and use the code posted there by Dev Asish.

    Dim strDocName As String
    Dim strWhere As String
    strDocName = "rptSomeReport"
    strWhere = "[RunID]=" & me!RunID
    DoCmd.OpenReport strDocName, acPreview, , strWhere


    This prints only the current record.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Print or Export the results of a Filter (not query

    Here's a <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=acc&Number=11397&page=2&vie w=collapsed&sb=5> link </A> to a previous discussion on printing the current record as well.
    Charlotte

Posting Permissions

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