Color change based on value (Changement de couleur selon la valeur)

Hello, in a LibreOffice form with integrated HSQLDB, I would like to know how to change the background color (a kind of conditional formatting)
of a frame, independent field, or other elements, depending on the value of another specific field.

Example: a square (independent field or other) would have a black background if the field named [A] is zero, and the square would change to a white background if the value of field [A] is equal to 1.

Bonjour, dans un formulaire LibreOffice avec du HSQLDB intégré, je voudrais savoir comment peut-on changer la couleur de fond (une sorte de mise en forme conditionnelle)
D’un cadre ou d’un champ indépendant ou d’autres éléments, selon la valeur d’un champ autre spécifique.

Exemple: un carré (champ indépendant ou autre) serait en fond noir si le champ nommé [A] est à zéro, et le carré passerait en fond blanc si la valeur du champ [A] est égal à 1

Is there anyone who could help me?

If a control has a property that is responsible for the background color, then the value of this property can be assigned by a macro depending on the current form record.

Here’s an example (source borrowed from @Villeroy ).
In the form, when changing a record, the background color changes if the temperature exceeds 10 degrees.
Celsius2.odb (15.7 KB)

Your Celsius2.odb is incomplete.
Link to original topic with my Celsius.odb: Conditional formatting in Base? - #3 by UncleRobin

Form controls of type “formatted field” and non-text values in the table grids support the same number formats as spreadsheet cells.
https://help.libreoffice.org/25.8/en-US/text/shared/01/05020301.html?&DbPAR=CALC&System=UNIX

1 Like