Jump to content
Sign in to follow this  
MartyW

Search Script Checkbox Field for Multiple Values

Recommended Posts

MartyW

I am trying to create a search of my database using a Check Box in the search to retrieve multiple criteria. It is a people database with first name, last name, gender and hair color. I can search the database on the first name, last name and if they are male or female fine. I also can search the database if the search hair color field is a radio button, where I can only select 1 choice. It works fine in that instance. However, I want to be able to search for people that may have different hair color and they both be returned in the search.
 
I have the following tables/fields:
 
Table 1: Person
Fields: 1. Id 2. First Name 3. Last Name 4. global Search field for Last Name 5. global Search field for First Name 6. global Search field for Gender 7. global Search field for Hair Color
 
Table 2: Gender
Fields: 1. Id 2. PersonIdFK 3. Gender
 
Table 3: Hair Color
Fields 1. Id 2. PersonIdFK 3. Hair Color
 
I have attached one example database with the radio buttons searching only 1 hair color that works and one example database with check boxes that I want to be able to search mutiple hair colors that is not working correctly.
 
If I click on multiple hair colors, I want it to return all those hair colors if all other criteria is matched. It is currently returning no values if more that 1 item is selected.
 
It seems when searching using the checkbox that is searching using an "and" statement instead of an "or" statement. Not sure where I can change that.
 
There is a script for both the Search and Clear buttons.

 

 

Search with Radio Buttons for Haircolor - works.fmp12 Search with Checkbox Set for Haircolor - not working correctly.fmp12

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  



×
×
  • Create New...

Important Information

Terms of Use