display all

  • Thread starter Thread starter Fie
  • Start date Start date
F

Fie

Hi,

I curently have a query set up that allows user to enter in school name
and date range.
ie [Please enter School name] and between[Enter Start date] and [Enter
Finish Date].
How can i get it so that the user can also bypass the enter school name
and just select date range and all details for every school are
displayed?


thanks
fiona
 
Fie said:
I curently have a query set up that allows user to enter in school name
and date range.
ie [Please enter School name] and between[Enter Start date] and [Enter
Finish Date].
How can i get it so that the user can also bypass the enter school name
and just select date range and all details for every school are
displayed?


Try using the criteria:

[Please enter School name] OR ([Please enter School
name] Is Null)

Don't get carried away with this quick and dirty approach.
It quickly becomes too cumbersome to be practical.
Eventually you will need to use a form for the user's
criteria instead of parameter prompts. Besides, you really
shouldn't open queries for user display/edits, use a form to
present the data to users. Forms provide much more control
over user actions and alternative ways of filtering the
data.
 
Assuming that there is ALWAYS a school name in the field (schoolName??). Try

Criteria: LIKE NZ([Please enter School name] ,"*")

If the user leaves the response blank, this should return all records that
have an entry in the SchoolName field.

Of course, you can use
Criteria: LIKE [Please enter School name] & "*"
if you want the user's to be able to enter just the start of the school
name.

I would suggest that is time for you to start looking at using a form to
gather the arguments (parameters) for your query. If you are interested in
exploring that option, check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm


Also here is a brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries
 
thanks..... reson i didnt do this is because am fed up trying to get it
to work... am using Access 97 and it dont like
the code... grrr was getting soooooo sooo annoyed and give up...

fie
 

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

Back
Top