Variable Criteria

LesleyParker

New member
Local time
Today, 03:11
Joined
Mar 12, 2008
Messages
7
I am creating a database for a dating agency (this is for my GCSEs). There are 3 tables, being Males, Females and Dates which combines the other two together. Each male and female have to enter their Name, Surname, Age, Hair Color and Eye Color. I'm wondering if it's possible to create a query where I, for example for hair color, can enter "blonde" or "brunette" and automatically only the females that are blonde or brunette, whatever I enter, are shown, not the others.
And another question, can I make a query where I can enter age 'from' and 'to' and only the people within that age are shown up?
The total ideal is if I am able to create a query where hair color, eye color and age are asked in a row, and then the result shows up.
Thanks in advance.
 
There's a very common element in queries called a parameter.

Create a query and add the fields you want to show in the result. In the field column for whatever data is going to be variable, go to the "criteria" line and add the parameter string. It looks like this:

Like [What hair colour do you want to see?]

Or, in other words,

Like [Type the question you want the users to see]

When the query is run, a dialog box will show up that the user can type criteria into.

For a range of variables, go to the criteria line and add two parameters:

Type the following:

Between [What is the starting age?] and [What is the ending age?]

Or,

Between [Bottom value of variable] and [Top value of variable]

Make sure your data type is correct - you need calculatable fields (date or number) to do ranges.
 
I don't want to get into sexual orientation issues but you should have one table for people regardless of their sex. Your queries can select only females or only males as desired. This also gives you the flexibilty to do same sex matches without any extra effort.
 

Users who are viewing this thread

Back
Top Bottom