You are viewing limited content. For full access, please sign in.

Question

Question

I need a Singleline to be cleared when radio button changes so that next lookup is refreshed

asked on February 4, 2022

I have a form that accesses a lookup table where it needs to

  • find the lines in the SQL that match First number (a TASK radio button);
  • find the lines that also only match the Second number (a second choice radio button);
  • then fill all the fields in the table.

 

I have this working by having a hidden singleline field that gathers both the First radio button choice and then the Second radio button choices (different ones are unhidden depending on the choice in the first radio button).  It has this formula in it, which grabs both radio button choices:  =ReviewHazardsFLHA1&ReviewHazardsFLHA2&ReviewHazardsFLHA3

The problem starts when the user changes the first radio button and begins looking at some other choices.  Basically, the singleline field has already filled with the variables from the two radio buttons already picked and now, instead of clearing out and redoing the formula, it ends up adding to the formula.

This is the singleline filled in after the first choices:

This is the singleline filled in after I begin alternate choices:

I need the FLHA2-T2 cleared out before it brings in the FLHA1-T3.  Can anyone help me with a solution?

0 0

Replies

replied on February 4, 2022

Hi Connie-

Trying to make sense of this, it sounds like your single line field concatenates all 3 radio buttons, but you only want to query on one of the radio buttons. Is that the case?

If so, you probably need some IF logic to tell it when to use which of the radio buttons.

If that's not right, could you include a screenshot of what you're working on? Having a little trouble visualizing it.

0 0
replied on February 7, 2022

Hi Pieter, thanks for looking at this!  This form is a Hazard Assessment form where, first they pick the task, then start viewing the different hazard tables.  As they click into the five different hazard tables, the lookup fills the rows from the hidden database.  The lookup needs to know which TASK and which HAZARD in order to pull the right info.

This is my current (theory) test form showing below with only three tasks listed so far (there will be many more eventually). 

Everything works beautifully as long as the person clicks on only one TASK and then starts reviewing the hazards.  They can change the hazard buttons as many times as they want and everything still works.  But if they try to change a TASK radio button, the lookup stops because now the hidden field is confused by the two choices (even though only one radio button is ever checked at any one time).

The singleline hidden field formula is: 

The two radio button values are:

 

0 0
replied on February 7, 2022

Hey, I was right about IF logic. Basically, if you change your TASKS choice, the original hazard list still has its value, even if hidden. So, use IF logic to say "IF Task = FLHA1 use ReviewHazardsFLHA1 ELSE IF Task = FLHA2 use ReviewHazardsFLHA2", etc.

Here's an example I made. Note that the variable names and choices are different from yours but hopefully make sense. There's no THEN logic operator, so you just put another IF in the false value.

=IF(TaskChoice="choice1",Hazard1,IF(TaskChoice="choice2",Hazard2,IF(TaskChoice="choice3",Hazard3,"")))

2 0
replied on February 7, 2022

Thanks, Pieter!

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.