From: Roberju on
In Access 2007, I have a table that has the following columns: First Name,
Last Name, Date of Birth, Hair Color, Height, Weight, and Current Location. I
want to create a form that I can go into and find all of the individuals that
were born after 1980 and with brown hair; or possibly all the individuals
with brown hair that weigh under 180. Basically I want to be able to search
the table based on inserting the specific parameters I want into a form. And
then I want to be able to see a report of all the individuals that meet my
parameters to print out. How can I go about this?
From: Steve on
You need to create three objects:
1. Query based on your table
2. Form that uses the query as a recordsource
3. Report that uses the query as a recordsource

Design of the query....
a) Needs to include all the fields from your table that you want to
display in your form and report.
b) You might want to make the Name a calculated field to combine first
and last names to:
JU, Rober
c) The query does not need criteria at this point

Design of the form .........
a) Make the form a continuous form
b) In the form header, create the following unbound fields:
1) Combobox based on a query that lists the unique names in your
table for selecting a name
2) Text box for entering the beginning date of the range for date
of birth
3) Text box for entering the ending date of the range for date of
birth
4) Combobox based on a query that lists the unique hair colors in
your table for selecting a hair color
5) Text box for entering the beginning height of the range for
height
6) Text box for entering the ending height of the range for
height
7) Text box for entering the beginning weight of the range for
weight
8) Text box for entering the ending weight of the range for
weight
9) Combobox based on a query that lists the unique locations in
your table for selecting a location
c) In the detail section of the form, add controls bound to your
recordsource
d) In the form footer, add two command buttons:
1) For the first button, add code to the click event that creates
a querydef based on your query and the parameters in the form header and
then requery the form. Look in the Help file for Querydef.
2) For the second button, add code to the click event that
creates a querydef based on your query and the parameters in the form header
and then open the report. Look in the Help file for Querydef.

Design of the report .....
a) Use the design view to create the report in the format you want.

Steve
santus(a)penn.com



"Roberju" <Roberju(a)discussions.microsoft.com> wrote in message
news:7CBDBE3A-0324-413A-96AD-6ACE8ABE914F(a)microsoft.com...
> In Access 2007, I have a table that has the following columns: First Name,
> Last Name, Date of Birth, Hair Color, Height, Weight, and Current
> Location. I
> want to create a form that I can go into and find all of the individuals
> that
> were born after 1980 and with brown hair; or possibly all the individuals
> with brown hair that weigh under 180. Basically I want to be able to
> search
> the table based on inserting the specific parameters I want into a form.
> And
> then I want to be able to see a report of all the individuals that meet my
> parameters to print out. How can I go about this?


From: Arvin Meyer [MVP] on
"Roberju" <Roberju(a)discussions.microsoft.com> wrote in message
news:7CBDBE3A-0324-413A-96AD-6ACE8ABE914F(a)microsoft.com...
> In Access 2007, I have a table that has the following columns: First Name,
> Last Name, Date of Birth, Hair Color, Height, Weight, and Current
> Location. I
> want to create a form that I can go into and find all of the individuals
> that
> were born after 1980 and with brown hair; or possibly all the individuals
> with brown hair that weigh under 180. Basically I want to be able to
> search
> the table based on inserting the specific parameters I want into a form.
> And
> then I want to be able to see a report of all the individuals that meet my
> parameters to print out. How can I go about this?

MVP Duane Hookom designed a query by form that is adaptable to most database
requirements:

http://www.rogersaccesslibrary.com/forum/dh-query-by-Form_topic12.html
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access