Solved

Search in Access

Posted on 2013-01-28
3
307 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
ID: 38826243
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
ID: 38826254
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
ID: 38826287
video tutorial on the same topic: http://www.youtube.com/watch?v=CTiA_4Me0cI
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

713 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