Searching a database by end user.

  • Thread starter Thread starter Iona via AccessMonster.com
  • Start date Start date
I

Iona via AccessMonster.com

HI,

Can anyone tell me is it possible to setup a search feature in my database
where on the contact form, the user could enter into the blank fields, by
name or organisation etc. and the form automatically fills in the right
record, and then when going to 'next record' it will navigate to the next
most relevant match?

Any suggestions how to make this work?

Thanks
 
Have you tried using records->filter->filter by form?

The above lets a user type criteria to one, or many of the fields on the
form..and then the form is restricted to that criteria...

I give the above a try....

You can also write code, and build a form, I give some ideas here:

http://www.members.shaw.ca/AlbertKallal/Search/index.html

However, you should try the ctrl-f to search, and also the above "filter by
form" that is built into ms-access.....
 
Hi Albert,

Thanks for the handy link... The search engine in the example looks to be
very similar to my own aims. Ive changed my approach since the last post.
Ideally I would like several search boxes, search by surname,organisation,job
title etc. which would locate a list of matches. and upon clicking the right
match, calls up the appropriate contact card. Do you think I will need to
get into coding for this? Im already out of my depth and not sure if I can
handle it. Do you know any good templates or examples out there I could chop
to fit?

thanks,

Iona
 
As mentioned, the file by form that is built in is not too bad......

As for a download example, I don't have one *yet*.

If you are going to code a form to search, then you can try the following:

Build a unbound form. Place a text box near the top. Lets call the control
txtLastName. Turn just about everything off for this form (record selector,
navigation buttons etc). This form is NOT attached to a table, nor any data
(we call this a un-bound form).

In addition to the above, you an build nice continues form that displays the
columns of data in a nice list. you can then put this form as a sub-form
into the above form.

Then, in the txtLastName after update event you simply stuff the results
into that sub-form.


dim strSql as string


strSql = "select * from tblCustomer where LastName like '" & me.txtLastName
& "*'"

me.MySubFormname.Form.RecordSource = strSql.

That is all there is to it. However, unless you have some coding skills,
the above might be difficult to follow.

There is a search example here:

http://www.datastrat.com/DataStrat2.html

and

http://www.mvps.org/access/forms/frm0045.htm

I also have some more screen shots of searching that might give you some
ideas here:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm
 
Brilliant Albert, thanks again for the assistance. i realise this is a
problem that is continually posted on the forums so you're great for taking
the time with me. Ill followup the examples and let u know how I get on.

Iona
 
Back
Top