Choosing values for queries

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.
 
J

JulieD

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
 
R

Rolls

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top