Rabu, 16 November 2016

Re: [MS_AccessPros] Search anywhere in a field



How are the filters applied?  Are you using parameters in your query that point to your form?  It would be more flexible to not use parameters - write a bit of code to build a filter string, then apply the filter when you open the form bound to the data you want to display.  If you do that, you can replace your batch/serial number combo with an unbound text box where the user can enter either criteria.  Or, you could provide two combo boxes - one that lists valid batch numbers, and the second that lists (perhaps filtered by the chosen batch) all serial numbers.  You would use the LIKE predicate in your filter string to search for just a part of the value.

Give me some more details - like the names of the combo boxes, their Row Sources, the name of the filtered form you want to open, and the names of the three filter fields.  Also, how is the batch number formatted - that is, what part is the batch, and what part is the serial?

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)

On Nov 16, 2016, at 11:13 AM, nigel@pegasusconsulting.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

In my production Route Card database I have a set of 3 fields to filter the information - users can use any one, and 2 or all 3 to filter the list of route cards (there are hundreds or records!).

The fields to enter the search criteria are unbound combo boxes. In the last of the 3 (batch number) I'd like the user to be able to enter text that is matched in any part of the string...at present the combo box only matches the characters at the start of the string (which I gather is the normal behaviour). The reason is that the batch number is actually made up from 2 parts - batch number then serial number - and some users prefer to work by serial number!

Is it possible to have Access match any part of the string to the text entered? If it is, can you tell me how as this is way beyond me!!




Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.



Tidak ada komentar:

Posting Komentar