Question:
create a 'search' function in Microsoft Access?
2010-11-09 17:55:06 UTC
I am in the process of building a database to for my company. I have a number of tables and I have created a number of forms that are bound to these tables. On one particular form I would like to be able to enter certain search terms such as suburb, city etc and be able to hit a button that will go through the thousands of records contained in my table and pick out all the records that contain my search terms. I know that this will have something to do with the actions that I put on the button but I just dont know what actions to select! Any help would be fantastic!

Cheers, Ash
Six answers:
BlueFeather
2010-11-10 14:16:41 UTC
Do you simply want to display a list of matching records, or do you want users to be able to select one and do something with it?



Do you want to search on one criterion at a time, or base the search on multiple criteria?



Are you searching for words CONTAINED WITHIN text fields, or perhaps searching fields that characterize records in some way? For example, one or more fields in a record might specify that it represents a large/medium/small city, a suburb, rural location, business address, home address, etc.



Answers to those questions would determine HOW to achieve your desired result.



If you want a detailed response, I suggest you answer the above questions in an email (see profile). I would be happy to help if I can.
?
2017-01-21 19:24:42 UTC
1
?
2016-12-15 17:13:32 UTC
Access Search Function
Petro
2010-11-10 11:22:04 UTC
I faced similar problem developing a database for my client and found a solution for it.

In Access there are OpenForm and OpenReport methods:

DoCmd .OpenForm(FormName, View, FilterName, WhereCondition, …).

Forth parameter – WhereCondition - is a string expression that's a valid SQL WHERE clause without the word WHERE.

I created a form based on a query that selects data from certain tables. Then there is a “search” form with the criteria fields and “search” button. On button click VBA, using criteria entered, builds a string that is passed as WhereCondition parameter to OpenForm method. It opens first form in datasheet view (so it looks like a table) and shows filtered data. Works perfectly!

There is a great article from which I got the idea:

http://www.databasejournal.com/features/msaccess/article.php/3837751/Building-a-Dynamic-Where-Clause.htm
2016-04-07 03:37:09 UTC
For the best answers, search on this site https://shorturl.im/awBSk



How does one create an automated function in Microsoft Access 2010...? You could use one of the following three techniques: 1. A query - and Action query to insert a new record (Append query). 2. VBA code to attach to an event in a form to add a new record 3. Data macro - which is new to Access 2010 that will trigger after update event for you. The exact requirement is not detailed enouhg in your question as to guide you to the best solution but non-programmers may want to seriously look at data macros (Access 2010) which is a new eBook I recently published and released [Access Database Tutorial]. Thanks Ben
2016-02-26 09:07:59 UTC
DOn't want to sound like a wuss, but wouldn't you prefer Excel? I'm a ACCESSOPHOBE!!!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...