Choosing values for queries

  • Thread starter Thread starter Scot B
  • Start date Start date
S

Scot B

Greetings,

Newbie question - I have a database to store comparable home information for
a real estate appraiser. He would like a form of some type where he can set
parameter values before running a query. This is something where he could
pick a minimum square footage, a zip code, number of bedrooms...then run the
query.

I know how to make a query prompt for parameters, but there are too many
variables to go through for every query. I can have him go into the query
in design view and set parameters, but that's not very "user friendly".

Any suggestions for how to handle this?

Thanks a ton for your help and expertise!

Cheers,

Scot B.
 
Hi Scot

here's an answer i provided to a user with a very similar question - it
should get you started (they asked specifically about a date parameter, but
it can be adapted for any field
****
create a query and in the CRITERIA line of the date field (the one you want
to use as the input parameter) type
[Enter Date]
now run the query and you will see that you are prompted to enter the date -
now build a report based on this (using the report wizard) and then when you
run the report you will be prompted for the date

then to make it nice and neat, create a form with an unbound text box (and
name the text box something like RPTDATE) then, go back to the query and
change the criteria to
Forms![whatever you called the form with the date on it].RPTDATE (use the
expression builder to get the exact syntax)

- put a button on this form - use the command button wizard, choose Report
Operations - Preview a Report (or whatever the exact wording is) - select
the appropriate report

now when you open the form, enter the date, press the button - the report
will display the information you want
***

let us know how you get on
and BTW you really don't need to post to so many groups - just choose one
that you think is most relevant - a lot of the responders here read a number
of groups.

Cheers
JulieD
 
If you know how to do Parameters in the query, Do
something like this. Like[enter the zip code]&* this
concatenates the wild card in to allow all values if they
enter nothing. This syntax will allow them to skip it or
hit cancel and continue to the next parameter.
 
You should not post to multiple newsgroups!

Short answer - The multiple criteria that are selected on your form need to
be transferred into a WHERE clause of a SELECT statement. Build this SQL
string, save the query definition, then run it to return a query result that
will generate data for your form or report.
 
Back
Top