Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2017
    Posts
    17
    Provided Answers: 1

    Answered: Add filter for data within a form?

    Hey all,

    I am trying to make reporting as easy as possible for my DB. Currently I have a query which is not super specific and pulls all of the data that is required for the form and I am applying a filter on the report in order to refine the data to display exactly what I want to see. Is there a way to apply a filter through a form? I'm thinking that I'll do something like this.

    Code:
    Private Sub btnCreateReport_Click()
    Me.Something.RowSource = "SELECT WhatIWant FROM Table WHERE Requirement =" & Me.txtRequirement "ORDER BY Requirement"
    Me.Something.Requery
    End Sub
    I'll probably also have the report open when the button is clicked as well.
    Is this efficient or is there a better way to do it?

    Thanks!

  2. Best Answer
    Posted by award73

    "Figured it out a few hours ago. Figured I'd update the thread for future reference.
    Code:
    Private Sub btnCreateReport_Click()
    
    DoCmd.OpenReport "Program Document Report", acViewPreview, , "RG =" & cmbRG
    
    End Sub
    "


  3. #2
    Join Date
    Jun 2017
    Posts
    17
    Provided Answers: 1
    Figured it out a few hours ago. Figured I'd update the thread for future reference.
    Code:
    Private Sub btnCreateReport_Click()
    
    DoCmd.OpenReport "Program Document Report", acViewPreview, , "RG =" & cmbRG
    
    End Sub

Tags for this Thread

Posting Permissions

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