Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2007
    Posts
    13

    Unanswered: Find using checkboxes

    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.

  2. #2
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    If you script the Find, you can insert the "==" in the search criteria as needed:

    Enter Find Mode[]
    Pause Script
    If [ not isempty(field) ]
    Set Field [ field; "==" & field ]
    End If
    Perform Find[]
    ...

  3. #3
    Join Date
    Sep 2007
    Posts
    13
    Thank you so much. Could you please explain with a little more detail? I'm new to Filemaker (3 weeks now).

  4. #4
    Join Date
    Sep 2007
    Posts
    13
    I'm working on this now. One question. If I use a Set Field while in find mode does it modify the actual data or just the find string?

  5. #5
    Join Date
    Sep 2007
    Posts
    13
    It works! Thanks.

    One thing though. I ended up needing to do a literal text match instead of a field content. I ended up with this

    "\"" & field


    I would have thought it should have been this to work
    "\"" & field & "\""

    both ways worked. Will it do a literal match with only a leading quote?

  6. #6
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    One thing though. I ended up needing to do a literal text match instead of a field content. I ended up with this

    "\"" & field
    That doesn't sound right at all. A Find for:

    "Newsletter

    or even

    "Newsletter"

    would find both: 'Newsletter' and 'Newsletter Do Not Mail'.

    Go back to the "==" method that I outlined above.

  7. #7
    Join Date
    Sep 2007
    Posts
    13
    I used a bad example. It should be

    Newsletter Recipients
    Newsletter Do Not Mail


    The reason I couldn't use the "==" is there are other checkboxes for this field and people could be members of other groups besides the Newsletter ones. With the "==" I only got members who were in the Newsletter groups only. If they belonged to anything else it didn't match.

    Thanks for the help. I've tested it and it works well.

  8. #8
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    In that case, just search for the value (without quotes).

  9. #9
    Join Date
    Sep 2007
    Posts
    13
    Without the quotes I get results from both. The case that causes the most problems is

    China Member
    China Non-Member
    2003 China Meeting

    Without quotes, if I select China Member I will get results from the other 2 also. If they had named them with an underscore instead of a space this wouldn't be a problem, but Filemaker matches on the China by itself and on Member by itself becuase of the space.

  10. #10
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    In that case you do need the quotes around the search string, since you want to find records containing the phrase "China Member", not just the words "China" and "Member". But records containing only the value "2003 China Meeting" would not be returned in either case.

  11. #11
    Join Date
    Sep 2007
    Posts
    13
    I'll test it again for the 2003 China Meeting, but I believe when I searched on China Member it returned results for 2003 China Meeting also.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •