Results 1 to 2 of 2
  1. #1
    Fabdav is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    22

    Report based of filtered data from a form

    I have a form displaying data pulled out from a query
    I am filtering the data from the form (filter by form, clicking in the filter bottom, etc)
    I would like to create a report which displais ONLY the record displayed in the form after the fileter is applied and not all the records that are originally displayed by the query
    Is this possible

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Here is some code that I use that is attached to a command button (Command28). The report is named Submission. You need to reference the Record ID shown in the DoCmd line for the particular record you want to show in your report. You will have to change your Form Name, Report Name, Command Button Name and Record ID to match what is in your Database.

    Code:
    Private Sub Command28_Click()
    On Error GoTo Err_Command28_Click
    
        Dim stDocName As String
    
        stDocName = "Submission"
    
        DoCmd.OpenReport stDocName, acViewPreview, , "[ID]=Forms!frmClients!ID"
    
    Exit_Command28_Click:
        Exit Sub
    
    Err_Command28_Click:
        MsgBox Err.Description
        Resume Exit_Command28_Click
        
    End Sub

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

Similar Threads

  1. Replies: 2
    Last Post: 01-15-2011, 10:56 AM
  2. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  3. Filtered Report
    By Desstro in forum Reports
    Replies: 3
    Last Post: 06-18-2010, 09:09 AM
  4. Printing a report based on one row of data
    By MEEMeyer in forum Reports
    Replies: 8
    Last Post: 03-04-2010, 05:45 PM
  5. Report based on query shows no data
    By hbograd in forum Reports
    Replies: 2
    Last Post: 12-18-2009, 12:28 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