Solved

Search in Access

Posted on 2013-01-28
3
275 Views
Last Modified: 2013-02-18
I have a form in MS Access. I need to add a search button on this form. The Search can be done on Five database Fields. If Found, I need a report display the results fitting the criteria.
How to achieve that?

Thanks
0
Comment
Question by:ramziabk
  • 2
3 Comments
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Create a form with the textboxes for your creteria and a button to open your report.

In your report's design, click ... next to the recordsource property.

In the query designer, enter criteria similar to the following for each field that needs to be filtered on:

Forms!YourFormName!YourTextboxName

Place the following VBA code in the click event of your command button:

Docmd.OpenReport "YourReportName", acViewPreview


(You'll have to subsitute your actual report, form and field names for all of these)
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
Comment Utility
These articles all show methods of doing what you are asking... and include sample databases:
http://allenbrowne.com/ser-62.html
http://www.accessmvp.com/kdsnell/SampleDBs.htm
http://www.access-programmers.co.uk/forums/showthread.php?t=114735

From the questions you have posted so far, it sounds like you are very new to Access... so digging into sample databases to see how these things work might help your learn and apply the concepts to your own database.
0
 
LVL 10

Expert Comment

by:deviprasadg
Comment Utility
video tutorial on the same topic: http://www.youtube.com/watch?v=CTiA_4Me0cI
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now