How to create a Search tool in a few steps (MS Access)
Create A custom search form in MS Access in a few steps
This blog shows how to create a custom form which can search for the given fields and produce a report according to the search criteria in MS Access.
In Microsoft Access, It mostly up to the wizard to choose what it actually can do for you, but that’s not always what we really want. Custom modification is perfection considering the requirements. Well, in this blog, I’ll show you how to create a custom search engine and generate a report based on the search.
Hope you have at least the basics in MS Access. First you need to create a table, name it “student information”. We will use the following attributes,
Student ID I First Name I Middle Name I Last Name I Phone Grade
Follow the next steps to create a query and generate a search engine based on the table you just created.
Open the query section and create a query by using wizard including whichever columns you prefer. In this example, we will choose the entire table in the query
After choosing the entire required field as in this case, all, click next until you finish creating the query by the wizard.
After finishing creating the query, run the query in order to be able to insert some information so as to know he search really works.
Below are a few information about students.
After inserting the Information, close the window.
Since the Query already exists, now we need to create a form. Using the Wizard, we can do this easily. One can create a form manually but using a wizard would be easier since we will be able to know the textbox easily. While creating the form, choose to create from a query instead of a table. Select all fields and click next. After the form is created, run the form in design view. Delete all the Information in the Text to create unbound entries.
Close the form, rename it to Search.
Now what we need is to set criteria on how to search. Open the query created earlier in design view. Right click a column and click totals.
On the criteria, write the following expression
Like [forms]![“Name of the Form”]![“Textbox Name”] & “”Criteria” As in our case, Form name is “Search” and the Textbox Name is the same as the field.
Like [forms]![Search]![Student_ID] & “*”
Continue with all fields using the above description, note change the Textbox Name only. Save the Query.
Next, we need a report to run the results. On the Report section and create a report using the query which already exists. Design it to suit your specifications.
On the Form Search, Insert a button to direct you to opening the report on preview.
Now our search form is ready to be used. On running the form view, by entering Information on any of the above textbox, the report below will be generated with values equal to the search. On this example, I choose to search 1 in the Student ID and the generated report is below.
On the form Search, you can enter any Number of restrictions to generate the report.
Related posts:

