?
Solved

Filter report with drop down box

Posted on 2013-10-25
2
Medium Priority
?
889 Views
Last Modified: 2013-10-28
I have a report "copy or trader holdings" that uses the query "copy or trader holdings" as its data source. I'd like to be able to filter the "books" shown in the report from the current all books to a single book. The list of books is in a table named "books," and I would like to be able to select from a drop down list that contains two fields: "trader" and "description," with the "trader" number being used to display only that "book" in the report.
0
Comment
Question by:jtbold2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 total points
ID: 39601847
You could create a form with a combo based on you "Books" table. I'm not sure exactly how that table is related to your "copy or trader holdings" query, so it's hard to say, but generally could do something like this on that form (perhaps in a button click event):

Dim s As String

If Nz(Me.YourBooksCombo.Column(0) , "") <> "" Then
  '/ the user selected something
  s = "YourBookFieldInTheQuery=" & Me.YourBooksCombo.Column(0)
End If

DoCmd.OpenReport "Copy or Trader Holdings", , , s

Obviously you'd have to change the names of the Forms and Report, as well as make sure that your Fields "match up" - that is, you replace "YourBookFieldInTheQuery" with the actual field name, and so on.
0
 
LVL 31

Accepted Solution

by:
Helen Feddema earned 1000 total points
ID: 39602753
Take a look at my Fancy Filters sample database.  It lets you filter by one or more fields of various data types, displaying the results in a datasheet subform, or print them in a report.
Here is a link for downloading it:

http://www.helenfeddema.com/Files/accarch129.zip

and here is a screen shot of the form:

Fancy Filters form
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question