Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i make fields in the database searchable 2

Status
Not open for further replies.

queen0fbats

Technical User
Dec 10, 2003
4
GB
This is another try! I have recently posted a thread "searchfields in access", but havent had much response. I am now DESPERATE to solve my problem, which is why I am reposting.

I have created a database from scratch, it has all the necessary fields and now also the data in it. I now need to set it up, so I can search the data, i.e. by company name, by post code and by city. I cannot find anything about this in the access own help and would appreciate it very much, if somebody could point me into the right direction.

Thanks in advance.
 
The reason why you get no replies is because this is sort of an awkward thing in Access. There are many ways to search, at a bunch of different levels.

1. Using "Find" in table view mode. Click on the field you want, press CTRL-F and type in your criteria.

2. Using "Find" in form mode. Much like table mode, only go to the form control instead of the datasheet cell.

3. Using a query and [parameters] - just set up a normal query, then put in the Criteria section of your 'searched field': [Enter criteria here:]. When you open the query, you will be prompted for your 'search info'.

4. Doing it via code, i.e. a search form - see above post. This is not a short, quick solution, but it's obviously the most useful.
 
Not sure what you are asking about here. If it's full text search, vanilla relational databases don't have a general search facility, curious as it may seem. When they were invented a third of a century ago, full text search was very esoteric. You may want to look at an alternative like MySQL.

On the other hand your question could be "How do I find all the records related to a particular company in the Company Field." If this is your problem then you need to read the documentation on the WHERE clause of SQL. In the Query (QBE) screen you put search values in the appropriate box and Access will format the SQL to search for these records.

 
thanks folks, this has helped me a lot. indeed i was looking for a way to extract certain data, like all companies starting in A for example. i truly did believe that there was an easy way of doing it, but i do realise now that it is far more difficult. seems i have to get my head round basic scripting.

thanks again!
 
You don't need scripting to select all companies starting with 'A'. Go into the Query Screen, select your desired fields and in the row marked 'Criteria', underneath the company name field, type: Like a*. Press the button and you'll have all the companies starting with A.

 
Hi,
For this need you can have an easy way.
Create a Query based on your table. In the criteria of the field Company put type line like this

Like[Enter the Value] & "*"

When you run the query, it will prompt a small inputbox saying "Enter the Value".
Enter any letter (A, B, c,..or Z) you need. The query will be filtered result of companies starting with that word.
You can develop more from this basic
Hope this help




Zameer Abdulla

 
To do what ZmrAbdulla suggested took me about one minute and five seconds. Now you can't grumble about that...

 
ZmrAbdulla's solution is perfect - NOW what if i wanted the input box to accept a product id OR allow a search of the product file [if i didn't know the id]. thanks in advance...

KoKo2
 
I have a similar problem and have used ZmrAbdulla's suggestion to partially fix my database. I would like to know if I can do the following and how would I take the suggestion ZmrAbdulla gave and maybe add to it? Here is what I have:
I have a table called Library Listings. In this table I have Call #, Author 1, Author 2, etc. all the way thru Author 6. I also have fields called Keyword 1, Keyword 2, etc. thru Keyword 4. I also have fields such as Title and Reference, but do not need to search on them. I currently have 2 buttons on the main switchboard, one to search by author and one by keyword. At this point I have it set up in the queries I built for each to search under Author 1 and Keyword 1, as suggested by ZmrAbdulla. I would like to find a way to search all 6 Author fields when I click on the button, same goes for the Keyword button. I am not up to speed on code building, so the easier the better. Thanks in advance for your help.

Andrea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top