Filter report by user input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Coolboy55
    New Member
    • Jul 2007
    • 67

    Filter report by user input

    I have a report that I'd like to filter based on the user's input. The user would select the month and year that they would like to see data from, and the report would return that data along with the selected month and year in the report header, perhaps in an unbound textbox. How would I go about getting the user input and applying the filter to the OpenReport method?

    Thanks!

    CB55
  • n8kindt
    New Member
    • Mar 2008
    • 221

    #2
    Originally posted by Coolboy55
    I have a report that I'd like to filter based on the user's input. The user would select the month and year that they would like to see data from, and the report would return that data along with the selected month and year in the report header, perhaps in an unbound textbox. How would I go about getting the user input and applying the filter to the OpenReport method?

    Thanks!

    CB55
    i just answered a very similar post last week. CLICKY

    if you have problems figuring out how to apply this to the OpenReport method, let me know

    Comment

    • Coolboy55
      New Member
      • Jul 2007
      • 67

      #3
      Originally posted by n8kindt
      i just answered a very similar post last week. CLICKY

      if you have problems figuring out how to apply this to the OpenReport method, let me know
      Ok, that works, but now I have another issue. I have 3 subreports, each of which feeds from a different query. The user now needs to input the month and year three times - once for each subreport. How could I prompt the user only once and copy that response to each query?

      Thanks!
      Last edited by Coolboy55; Apr 16 '08, 06:37 PM. Reason: Fixed typo

      Comment

      • Coolboy55
        New Member
        • Jul 2007
        • 67

        #4
        Originally posted by Coolboy55
        Ok, that works, but now I have another issue. I have 3 subreports, each of which feeds from a different query. The user now needs to input the month and year three times - once for each subreport. How could I prompt the user only once and copy that response to each query?

        Thanks!
        Does anyone have any ideas on how to solve this one?

        CB55

        Comment

        • n8kindt
          New Member
          • Mar 2008
          • 221

          #5
          Originally posted by Coolboy55
          Does anyone have any ideas on how to solve this one?

          CB55
          i'm assuming u created a form just as i did. if so, create a button on the form and place this code into the onclick event:

          Code:
          Private Sub Continue_Click()
          DoCmd.OpenReport "rptYourTitle", acNormal
          Forms!frmYourTitle.Visible = False
          End Sub
          this hides the form whenever u click the button. access can still access (lol) the values that were input on the form since it is being hidden--not closed.

          of course, if the user tries opening the form again, you want the form to reappear so they can change the values if necessary. so in the OnLoad event paste this in there:

          Code:
          Private Sub Form_Load()
          Forms!frmYourTitle.Visible = True
          End Sub
          hope that helps.

          regards,
          nate

          Comment

          Working...