I have an Access form that runs a search on a query and returns the results to a listbox on the same form. I have two question regarding the search functionality.

1. Is it possible to search for the exact value for instance I have a Movie rating column and if I put in G and search I get the results for G, PG and PG-13 when all I wanted were G movies..

2. Is it also possible to search starting with the first letter. For example if I put an S in the Movie title line it will only return Movies starting with the letter S and not every single Movie with an S in it.

Thanks in advance for any help it is greatly appriciated. :cheesy:

12 Years
Discussion Span
Last Post by madmital

You probably "search" you database using LIKE '%value%' The above means whatever may come before, value, whatever may come after.

To select only rows where a specific column equal 'G', you need to use LIKE 'G' To select only rows where a specific column equal 'S' and then whatever, you could go LIKE 'S%' Of course is these different type searches is to be carried out form the same input search field, you need some sort of evaluation.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.