"I want it to auto check a check box on the next screen"
Doesn't tell us enough about how you've set this up. You have layout #1 where your user clicks the first check box (I recommend a radio button here.) Then you have Layout #2 where you want to show another selection to be made automatically. We need to know about the tables that each layout refers to and how they are related. We also need to know what else is to happen here. Should this action first create a new record on the second layout before entering the specified value?
Here is the setup...
Layout #1 (Application Table)
Do you own a car. = (Drop Down Menu) = YES OR NO This field name is _FKDocumentationCheck
Layout #2 (Application Table) = Lists of documentation populated in checkboxes from the table (Documentation.)
Screen Shot shows how they are related.
Trying to accomplish:
If User answers yes to ...do you own a car... Then auto check from the populated list on layout 2 that uses a value list from the table Documentation... to autocheck bring Vehicle Registration.
Is the second item to be selected a field in Documentation or Pre Screen App Main? (don't see any fields in Documentation that you can use for this purpose in your screen shot.)
Both layouts Phil use the same table. They use Pre Screen Application Main. However i have a separate table which is documentation which is in a value list on the 2nd layout that is autopopulated by the documentation table.
The 2nd item to be selected is in the documentation table.
__PKType of Doc ... from documentation table is related to Pre Screen App Main _FKDocumentationCheck .
In which case, you wouldn't seem to need the relationship if it's just to supply a value list for your check box formatted field in the other table.
Ok, that sets up something that can be handled by an auto-enter calculation.
On your second checkbox formatted field, add this auto-entered calculation:
If ( valueCount ( FilterValues ( Self ; "Vehicle Registration" ) ) Or ( DoYouOwnacarField = "No" ) ; Self ; List ( self ; "Vehicle Registration" ) )
Then clear the "do not replace existing values..." option.
Phil that works however if i go back and then change the question to NO i dont have a car... The check box on bring in vehicle registration is still checked. Also if you create a new record and select NO to i dont have a car...Bring in Vehicle registration is still checked.
Only way to take it off is to manually uncheck it... However you cant manually uncheck it if you answered YES to do you own a car. Which is great but i need it to not automatically check if the answer is no.
Unfortunately, you can't "uncheck" a selection in a checkbox group with an auto-entered calculation, unless you use FileMaker advanced to add a custom function to your file.
To "uncheck" that option when the field is changed back to "No", you'd need to use a script trigger to run a looping script to find and delete that value from the list of values stored in that field.
I have Filemaker advanced however, what do you think is the easiest to fix this?
You can use Manage Custom Functions to start a new custom function. Copy and paste this function definition into the function editor:
// RemoveSubList ( SourceList ; SubList )
// Return a list of all values in SourceList that are not also listed in SubList
// SourceList: A return separated list of values
// SubList: a Return separated list of values to be removed from SourceList
Let ( [ ListItem = GetValue ( SubList ; 1 ) ;
SubListRemanent = RightValues ( SubList ; ValueCount ( SubList ) - 1 ) ;
FilteredSourceLista = Substitute ( ¶ & SourceList & ¶ ; ¶ & ListItem & ¶ ; ¶ ) ;
FilteredSourceListB = Middle ( FilteredSourceLista ; 2 ; Length ( FilteredSourceLista ) -2 )
Case ( IsEmpty ( SubList ) ; SourceList ;
RemoveSubList ( FilteredSourceListB ; SubListRemanent )
) // case
) // Let
Make sure that the function is named SourceList and to add the parameters SourceList and SubList.
Now we can modify our auto-enter calculation as:
Case ( DoYouOwnacarField = "No" Or IsEmpty ( DoYouOwnacarField ) ; RemoveSubList ( self ; "Vehicle Registration" ) ;
valueCount ( FilterValues ( Self ; "Vehicle Registration" ) ) ; Self ;
List ( self ; "Vehicle Registration" )
It wont let me add the parameter SourceList... Says its already in use.
Hmmm, wonder if you need to add the parameters, then paste the function definition.
It seems you cant name the function the same as a parameter.