Mostrar unos campos B, C, D según el valor seleccionado de Campo A que es de tipo Enum

Quiero hacer visible unos campos solo cuando se selecciona algunos valores de otro campo de tipo Enum que son representados en el formulario como botones. La lógica es lo siguiente: cuando selecciono “Caja cartón” o “Caja madera” los campos donde tengo que poner las medidas de las cajas se tiene que hacer visibles, de lo contrario que se oculten estos campos, porque las otras opciones no tienen medidas.

Entonces cuando se selecciona el valor “Sin embalaje” o “Plástico burbujas” los campos tiene que estar ocultos como se puede ver en las imágenes de abajo.

Y si se selecciona “Caja cartón” o “Caja Madera” los campos tienen que ser visibles como se puede ver en las imágenes de abajo.

Primero pensé que se podría solucionar con esta expresión:
Si lo que se ha seleccionado es diferente de “Sin embalaje” o “Plástico burbujas” los campos se hagan visibles. Poniendo la expresión en todos los campos que quiero mostrarlos en el Show_If.

OR([Tipo de Embalaje]<>“Sin embalaje”,
[Tipo de Embalaje]<>“Plástico burbujas”
)

PERO NO FUNCIONO.

Después he cambiado de estrategia cambiando la forma de pensar:
Si lo que se ha seleccionad es igual con “Caja cartón” o es igual con “Caja madera”, que se hagan visibles los campos.

OR([Tipo de Embalaje]=“Caja cartón”,
[Tipo de Embalaje]<>“Caja madera”
)

Y sorpresa FUNCIONO.

Pero no estuve tan satisfecho porque la expresión me parecía larga y encontré la solución que me ha convencido y funciona igual que la anterior.

IN([Tipo de Embalaje], LIST(Caja cartón, Caja madera))

Para completar la logia del formulario he hecho que cuando los campos son visibles que sean campos obligatorios, que no se puede dejar sin datos. Para esto he puesto la misma expresión, pero en Require del apartado Data Validity.

Espero que os sea de utilidad.

6 3 2,357
3 REPLIES 3

The screenshots are helpful but it would be great if someone from the community translated this to English and posted it here.

[Via Google Translate. -steve]

I want to make some fields visible only when selecting some values ​​from another field of Enum type that are represented in the form as buttons. The logic is the following: when I select “Cardboard box” or “Wooden box” the fields where I have to put the measures of the boxes must be made visible, otherwise these fields are hidden, because the other options do not have measures .

So when the value “No packaging” or “Plastic bubbles” is selected the fields have to be hidden as can be seen in the images below.

[IMAGE]

[IMAGE]

And if “Cardboard box” or “Wooden box” is selected, the fields must be visible as can be seen in the images below.

[IMAGE]

[IMAGE]

First I thought that it could be solved with this expression:
If what has been selected is different from “Without packaging” or “Plastic bubbles” the fields are made visible. Putting the expression in all the fields that I want to show them in the Show_If.

OR ([Type of Packaging] <> “Without Packaging”,
[Type of Packaging] <> “Bubble Wrap”
)

BUT IT DIDN’T WORK .

Afterwards, I have changed the strategy, changing the way of thinking:
If what has been selected is the same with “Cardboard box” or it is the same with “Wooden box”, make the fields visible.

OR ([Type of Packaging] = “Cardboard box”,
[Type of Packaging] <> “Wooden box”
)

And surprise IT WORKED .

But I was not so satisfied because the expression seemed long to me and I found the solution that convinced me and it works the same as the previous one.

IN ([Type of Packaging], LIST (Cardboard box, Wooden box))

To complete the loggia of the form I have made that when the fields are visible that they are mandatory fields, which cannot be left without data. For this I have put the same expression, but in Require of the Data Validity section.

[IMAGE]

I hope it is useful to you.

Está muy buena la solución propuesta, es de mucha utilidad, gracias por compartir.

Top Labels in this Space