Solved

Search in Access

Posted on 2013-01-28
3
296 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ms access 2010 vba, copy table from db1 to db2 from db3 27 43
Attachment field in SQL 3 26
Question about DB Schema 27 52
Field naming convntions - MS Access 7 22
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

785 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