wvdb Posted October 19, 2007 Posted October 19, 2007 I'm working on a database where they often search using checkboxes. The value lists for the check boxes contain spaces and this is causing incorrect result sets to be returned. Example list values would be 1. Newsletter 2. Newsletter Do Not Mail If they click the Newsletter in find mode the results returned will include both Newsletter and Newsletter Do Not Mail. Is there a way to force it to find an exact match only. I know how to do this with "" or == but not using a checkbox. Thanks
comment Posted October 20, 2007 Posted October 20, 2007 To do an OR find, you need to create a separate find request for each checked value. Here's an example of a script that does this - you will need to modify this so that each request is for an exact match. http://www.fmforums.com/forum/showpost.php?post/225796/ Another option is to skip find altogether, and get the matching records by a relationship instead.
comment Posted October 20, 2007 Posted October 20, 2007 LaRetta pointed out to me that my solution assumes each record has only one selected value. If this is not so, a find will not work here - unless you modify your value list so that no single value is completely contained in another. Going to related records through a relationship should still work fine.
wvdb Posted October 21, 2007 Author Posted October 21, 2007 I got this to work with some help. I did a script to 1. enter find mode 2. use Set Field to put quotes around the selected field value while in find mode. 3. preform the find
LaRetta Posted October 21, 2007 Posted October 21, 2007 If you try to find Newsletter using the method you describe, you will also get records with Newsletter Do Not Mail in them.
wvdb Posted October 21, 2007 Author Posted October 21, 2007 I used a bad example. It is actually Newsletter Recipients Newsletter Do Not Mail
Recommended Posts
This topic is 6247 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now