Solved Forms: Conditional formatting for multiple fields (1 Viewer)

Sarah.M

Member
Local time
Today, 09:02
Joined
Oct 28, 2021
Messages
335
Hi, Plz note, My VBA is blocked by IT for security reason (Cybersecurity).
I can use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
----------------------------------------------
I select multiple fields, I want to say in the Conditional formatting expression If any of those selected filled is Null mark the background to green
I do not want to do this IsNull(Contorl1) IsNull(Contorl2) IsNull(Contorl3) becuse I have many controls 😒

Sample attached
plz help 🙏
1654807700844.png
 

Attachments

  • ConditionalFormatting.accdb
    672 KB · Views: 133

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:02
Joined
May 21, 2018
Messages
8,463
Make 1 hidden text box "txtCon"
control source:
=[txtBox1asShortText]+[txtbox2AsNumber]+[txtBox3AsDateTime]

Conditional formatting:
expression is
isnull([txtCon])

When you use a plus sign in concatenation then (null + a value = Null). So if any are null the value is null.
 

Sarah.M

Member
Local time
Today, 09:02
Joined
Oct 28, 2021
Messages
335
Make 1 hidden text box "txtCon"
control source:
=[txtBox1asShortText]+[txtbox2AsNumber]+[txtBox3AsDateTime]

Conditional formatting:
expression is
isnull([txtCon])

When you use a plus sign in concatenation then (null + a value = Null). So if any are null the value is null.
Thanks!

All fields are shaded even non-null fields, is there a way to make it shade only empty fields?

Sample attached
 

Attachments

  • ConditionalFormatting.accdb
    672 KB · Views: 147

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:02
Joined
May 21, 2018
Messages
8,463
Sorry I misunderstood. I thought you wanted the whole record hilited if one of the fields was null. Unfortunately I think you are stuck with writing a condition for each control. If you had use of VBA you code code the conditions, but since you do not you are stuck. How many controls do you have to format? it cannot take that long.
 

Sarah.M

Member
Local time
Today, 09:02
Joined
Oct 28, 2021
Messages
335
Sorry I misunderstood. I thought you wanted the whole record hilited if one of the fields was null. Unfortunately I think you are stuck with writing a condition for each control. If you had use of VBA you code code the conditions, but since you do not you are stuck. How many controls do you have to format? it cannot take that long
I have ten fields. I am looking for the fastest way to make conditional formatting for multi fields.
I don't want to do them one by one
I want to learn easy tricks helps me to make work faster
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:02
Joined
May 7, 2009
Messages
19,169
here is another CF.
note i renamed your textbox.
 

Attachments

  • ConditionalFormatting.accdb
    672 KB · Views: 144

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:02
Joined
May 21, 2018
Messages
8,463
Code:
I want to learn easy tricks helps me to make work faster
Again unfortunate. There are no easy tricks when you have both hands tied behind your back, since you cannot use vba. This would be trivial with VBA, but you are stuck doing it the long route. However, 10 controls could be done far faster than amount of time to write this thread.
 

Users who are viewing this thread

Top Bottom