• Print or Export the results of a Filter (not query

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Print or Export the results of a Filter (not query

    Author
    Topic
    #353152

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #515706

      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.

    Viewing 0 reply threads
    Reply To: Print or Export the results of a Filter (not query

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: