I want to create a search box in access

D

Dethra

I have a database that I can create a query on, to bring up certain details
that I need to look at, without all the fluff.
When i run the query, I need to create either a macro, or a query, that will
show me a search box, so that I can search forspecific postcodes in my query.
is this possible with Access 2007? Is anything similar to this possible,
that will save me having to go to the filter everytime i want to search for a
new postcode?
I've spoke to MS and trawled the internet, and no one seems to be able to
help me.

Anything would be appreciated.
 
A

Allen Browne

You must use a form to do this. It can be in Continuous View if you want it
to show multiple rows.

It is very easy to create an unbound text box (or combo) in the Form Header,
and use its After Update event procedure to filter the form.

There's some simple code here:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

This one allows you to specify which field to search (choose from a combo),
and what value to search for (type in a text box), and applies the filter
with each character you type:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html
It's very easy to use: copy, paste, and set one property.

This one is a more comprehensive example, showing you how to offer a filter
on several fields in combination:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html
It involves writing more code (specific to the fields you want to offer.)
The screenshot illustrates how a continuous form can be set up to show
multiple rows.
 
D

Dethra

Thanks for that Allen, but I can't use this in Access 2007.
I'm new to this, so all the coding goes over my head. I'm trying to make
heads over tails here, but the information which you provided, whilst very
good, is unusable.

I do understand that the coding will essentially be the same for all the
programs, but 2007 is so much more different to the previous versions I have
seen.

Do you have anything else? I tried the forms, and that didn't get me
anywhere. I created a Split Form, but could not randomly search postcodes,
and it would not bring up all the details.
 
A

Allen Browne

If you are using Access 2007, there is a Search box in the horizontal
scrollbar of your query. Just use that.
 
J

John Spencer

You could try a parameter query. This is the simplest (and least flexible)
method.

Field: PostCode
Criteria: [Find which postcode]

This will automatically display a dialog box everytime the query is
executed. It will allow you to specify ONE postcode.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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