Can I pass a form's data using Access 2007's filter cmds in the ribbon to a report?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elaine Huseby
    New Member
    • Mar 2011
    • 2

    Can I pass a form's data using Access 2007's filter cmds in the ribbon to a report?

    I have a form "PartsAndInvoic es that has all the parts in the database listed in split form view. I want the user to use Access 2007's filter section on the ribbon to choose mutiple filters. Me.Filter may equal ([Lookup_cboDNRCI D].[DNRCNUM]="dnr1940"). I tried pass ing me.filter to the report but get all the records in the report not the custom filtered set.
    Private Sub cmdPartsNInvoic eReport_Click()
    Dim strFilter As String
    strFilter = ""
    If Me.Filter = "" Then
    MsgBox "Apply a filter to the form first."
    Else
    DoCmd.OpenRepor t "rptPartsAndInv oicesAll", acViewReport, Me.Filter
    End If
    End Sub

    Lookup_DNRCID.D NRCNum is something that Access makes up by appending LookUp_ to an existing field. If you look in "Advanced, Advanced filter sort in the ribbon, their is a query there built by Access. (see attachment)

    The form has a combo box "cboDNRCNum " that looks in a table for dnrcid which is a key number and DNRCNum which is text for license numbers on vehicles that we have built.
    Can I somehow use Access's filter set by the ribbon or do I need to build my own filter combo boxes on the form (really time-consuming) and then pass those to the report?
    Attached Files
Working...