searching fields forms

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Searching fields in forms

Searching fields in forms

resolvedResolved · High Priority · Version 2003

Chantil has attended:
Access Intermediate course
Excel Intermediate course

Searching fields in forms

I have a form in an access database which often needss searching to see if records have been previously entered. I have been using the Find function but I would like it to filter the cases so that the relevant ones can be displayed.

I know that you can set up a command button to search a particular field and filter accordingly but I don't know how to do it.

I would be grateful if someone could tell me how to go about this. Thanks

RE: Searching fields in forms

Hi Chantil,
As you question seems in waiting for a while I thought this might help.
I am not exactly sure whether you want to find records that are present for particular fields or do a specific search. I will guess the latter. To do this open the form you wish to search on. Open it in design mode, select the combo box button in menu bar and click and drag to create the box into a blank space on your form, preferably quite near the top or bottom of the form to allow for a good list length. You will see 3 options. Select Find a Record on my Form Based on the Value I Select in my Combo Box. Then press Next and chose the field by which you wish to search, and then go on to Finish. You can then go to form view to check the result. You should get a drop down showing 8 values in your chosen field and scroll bar if you have more than 8 in the list. I often prefer to see more than 8 list items at a time. To alter this go back to design view and double click on the combo box to call up properties (or you could right click and select propeties). Go to the Format Tab and you will see List Rows about one third the way down which is usually on 8 and you can change this --try 30 or 40. If you are searching on a field that has duplicates you either need to create a twin column combo or add Group By to the undelying query which I will explain.

This search combo box allows you to either select from the list, which takes you straight to the record you want, or you can type a value in. If you type a value in you need to click into another cell to trigger it. It is better to add a save record button next to the combo but label it GO or similar so as not to confuse the user. You can add further search boxes to the same form that search by different fields.

You can limit the search behind the list by returning to design mode and properties in the combo box, go to Data Tab, click into the Row Source cell anywhere preferably at the end to make the dotted box at the end appear. Click on that and you will see the query that feeds your list. Here you can add criteria to your selected field. To remove blanks ie see records entered only add the Not Null criteria. To stop duplicates in the list add Group By. You can add other fields to the query to create more complex criteria conditions.

I hope this helps.
Mark

RE: Searching fields in forms

Thanks Mark, that's great!

I'll give it a go!

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Relationship maps

It is important to create proper relationships between tables. You can use Access to help check your designs and evaluate them by printing them in graphical format to help with design purposes


Click on the Tools menu, click Relationships.
On the File menu, click Print Relationships. View or print as required

View all Access hints and tips


Server loaded in 0.08 secs.