conditional formating with VBA onLoad (1 Viewer)

theDBguy

I’m here to help
Staff member
Local time
Today, 13:43
Joined
Oct 29, 2018
Messages
21,503
Note that whilst you can have up to 50 format conditions using the CF wizard, you can only have 3 format conditions per object using VBA. There is an obscure workaround to that limit but in general there is no advantage using VBA for this purpose.
@isladogs I thought we already sorted that out earlier. I'll do some digging through prior threads.

Edit: Found this old thread.
 

isladogs

MVP / VIP
Local time
Today, 21:43
Joined
Jan 14, 2017
Messages
18,252
@isladogs I thought we already sorted that out earlier. I'll do some digging through prior threads.

Edit: Found this old thread.

Hi
Thanks. I was indeed referring to that thread. I've successfully used @Royce's method in the first post.
But unclear 'what had been sorted out earlier'?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:43
Joined
Oct 29, 2018
Messages
21,503
Hi
Thanks. I was indeed referring to that thread. I've successfully used @Royce's method in the first post.
But unclear 'what had been sorted out earlier'?
That you can have more than three (3) FormatConditions when using VBA.
 

isladogs

MVP / VIP
Local time
Today, 21:43
Joined
Jan 14, 2017
Messages
18,252
That you can have more than three (3) FormatConditions when using VBA.

Yes, but as I said originally, only if you are aware of the workaround which AFAIAA isn't mentioned in any official MS documentation
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:43
Joined
Oct 29, 2018
Messages
21,503
Yes, but as I said originally, only if you are aware of the workaround which AFAIAA isn't mentioned in any official MS documentation
Funny thing is; although that thread I linked to started out as saying it's a "workaround," it's not the same demo I seem to remember. I thought I posted one (somewhere) where multiple colors were showing? Still, though, if you open the form in design view in that demo and check for any Format Conditions set at Design View, you won't find any. And yet, when you run it, more than three FCs are applied. So, either it's not really a workaround, or MS may have fixed the problem already (I just didn't hear about it).
 

isladogs

MVP / VIP
Local time
Today, 21:43
Joined
Jan 14, 2017
Messages
18,252
Who knows? Anyway, there are other approaches with millions of possible colour formats (256*256*256)
1589224455348.png

See http://www.mendipdatasystems.co.uk/colour-conditions/4594464193
 

Users who are viewing this thread

Top Bottom