conditional formatting on a form

lala

Registered User.
Local time
Today, 08:12
Joined
Mar 20, 2002
Messages
741
Hi
i want to have more than 3 conditional formats for my controls
how is that done?

the conditional formatting box only gives you 3, but i think there's a way to add more through code

anyone knows?
 
What kind of form are you using (Single/Datasheet/Continuous) and what kind of formatting are you trying to do?

BTW, you actually have 4 conditions with Conditional Formatting, the fourth being the formatting when the other three conditions aren't met.
 
yeah, i know, but that' doesn't help me

i'm using a continuous form and i need very simple formatting
there's a "status" field (combo box) on the form, and depending on what the value is, i want the entire line to change color
like if it's "ignore", it goes gray, if it's "keep in mind" it goes red, if it's "just placed" it goes green
and i need a few more
 
also, does it matter what kind of a form i'm using?
i thought that it works the same for single and continuous forms, and for reports as well

anyway, i know how to do the formatting, it's already in place
i just need to know how to add beyond the 3 conditions they're giving us
 
Could you have two sets of fields/textboxes overlaying each other. The top set get colours 1,2 and 3 from conditional formatting. The conditional formatting would also give colours 4, 5 and 6 to the underlaying group of text boxes and the conditions that would give colours 4, 5 and 6 to the underlying text boxes would also make the top set of textboxes have a transparent background.
 
what do you mean that all the records can change
it only changes the ones that meen the criteria

i had no problem with that so far


but what's the point of having 2 sets of boxes?
you mean if the status is the 4th choice, then make the first set invisible and make the second set visible?

yes, if there's no way of adding conditional formats, i will think of a workaround
but i was hoping that there's a way to code it and have as many as i want

so noone knows of a way to do that?
 
Normally if you want to extend the range of conditional formatting you would use code and a form/report event, but as a continous form is seen by ACCESS as only one form all records would be changed so its a no go that way. Hence the question from those trying to help, and smart alec responses will turn them away.

Brian
 
what do you mean that all the records can change
it only changes the ones that meen the criteria


Continuous forms let you see each record. Before conditional formatting if the colour was changed on a record because of conditions it happened to all records. A work around with font was easy as you have a few overlaying fields with the top fields having transparent background and for any set of conditions all fields except one were null.

Make the background transparent for the top set of textboxes when the conditions affect the underlying text boxes.

yes, if there's no way of adding conditional formats, i will think of a workaround

It is a work around I am suggesting.

but i was hoping that there's a way to code it and have as many as i want

Perhaps there is but I don't know how to do it.
 
few things
first of all, what smart responses? i'm very thankful for everyone who takes the time out to even read my problems
i love this site, i've come here many times with the most annoying problems, and there was always someone who woud figure it out
so if something sounded rude, it wasn't meant to be


and now, why wouldn't code work?
it works fine with continuous form now
so you're saying that once you do it by code, it does something different and won't work with continuous?
can you still tell me how to do it? i'd like to mess around with it?

also, so what you're saying is that it can't be done?
 
Mike
im not sure how that's going to work

you're saying to put 2 boxes one on top of the other, both visible, but the top one transparent
right?
and then?
 
Yes, the kind of form does matter. The type of formatting you're speaking of can only be done in a Continuous view form using the Conditional Formatting from the menu. The only way to do conditional formatting from code is to use the Form_Current event, and this means that when you move to a record where "Ignore" is the cbo value, all fields for all records will turn gray. When you move to a field with "Just Placed" they'll all turn green and so fourth.

The reason for this is that a form really only has one of any given textbox; each record has a different instance of this same textbox . If you have a textbox named "Customer" for instance, your form only has one textbox of that name, so if you change its color, every instance of that control will change color.

On a Single view form, this doesn't matter, because you only see one record at a time.
 
i see

but if that's the case (and i'm not doubting you in any way), then how were they able to get it to work for the first 3 conditions?
 
I have not done this but similar is done with font.

Make a copy of each of the textboxes in question. The data will be the same but the name will be different and you can't change the name of the new textboxes to the field names as they are already taken.

Let's for this exercise call them textboxes1 and textboxes2. Textboxes2 will be the copies and will be overlaid on top as that is the easiest way.

Let's say assign colours 1, 2 and 3 to textboxes2 and colours 4, 5 and 6 to texboxes1.

For the top set of textboxes (the copies) set the background to transparent.

Now do the conditions for each set of textboxes and for the 3 colours each.

The conditions that would give colours 4,5 or 6 to the underlaying textboxes should mean the top set are transparent. I think the top set of textboxes will rvert to their setting of transparent when conditions are not met for them.
 
oh
very interesting concept
i will give it a try
 
They can do it with Conditional Formatting because they wrote the program code that way! Micro$oft can pretty much do anything they want with their own apps, since they have the source code!
 
i get that
i just don't get why they couldn't make it more than 3


thanks everyone for your time and help
 
I disagree... if it can be done via the MS Access conditional formatting wizard, I'm sure it can be done via VBA. This is something I've been wanting to do for a while but haven't taken the time to figure out how to do it. In my search for a solution I came across this thread. When I figure it out I'll re-post with the solution because solutions to problems is what I create!
 
I disagree... if it can be done via the MS Access conditional formatting wizard, I'm sure it can be done via VBA. This is something I've been wanting to do for a while but haven't taken the time to figure out how to do it. In my search for a solution I came across this thread. When I figure it out I'll re-post with the solution because solutions to problems is what I create!

access 10 and possibly access 07 lets you do it. back when i posted i didn't have access 10


ETA just reread the thread and remember what this was for. this was for an access 03 database for an office that doesn't want to go to office 07
 
Last edited:
Yes thank you lala. Their are apparently lots of posts that cover this subject now. But all of them that I looked at referenced the sane code example authored by Frank C. Rice which is a good example. Since I code everything in VBA it's been a very long time since I've had to use MS Access expressions... [FONT=&quot]Which is necessary if you want full extensibility using the FormatConditions collections object. It’s kind of strange that they didn’t make this fully VBA instead of reverting to “expressions”, but at least with the expressions it’s more extensible. [/FONT]
 

Users who are viewing this thread

Back
Top Bottom