By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,560 Members | 2,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,560 IT Pros & Developers. It's quick & easy.

Form to Select Criteria for a Report

P: 18
I would like to create a form that allows users to select criteria to run a report. There will need to be 4 list boxes where they can select one or multiple options in each list box.

The list boxes are:

Product
Status
Priority
Type

I then need a report to run based on these selections. I am new to access and I'm not even sure where to start.

I appreciate the help and thank you in advance.
Oct 29 '08 #1
Share this Question
Share on Google+
1 Reply


P: 68
Hi

I'm assuming you know how to create a form, and how to populate combo boxes.

Note that the values in your combo's must match those in your queried tables. In situations like this, I usually populate my combo's by using 'totals' type queries off the relevant tables rather than by entering the values by hand, e.g. create a query to count how many of each status type exist in the table, and use this as your combo list.

Re filtering your report query, the simplest way for a beginer is to create the query for the report, then set the criteria for each of the filtered fields to the value in the relevant control on the form, then have a button on the form to run/open the report.

Use the 'builder' in the query design to easily select the right form control and syntax. In my experience it makes life much easier if you keep your field and control naming consistent and logically connected, i.e. don't just accept the default names access will give to your controls. So for instance if I have a ProductID field in my table, I'll normally call my combo 'cboProductID' or if it was a text box 'txtProductID', this helps me know exactly what I'm using/looking for etc.

You could alternatively do it through code by creating and executing the SQL statement for the report in VBA. Not hugely difficult but in my view best left until you have a little experience with VBA as it can be very frustrating when first doing queries on the fly.

good luck
Kevin
Nov 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.