if is conditional formating true then...

mukky

Registered User.
Local time
Today, 12:15
Joined
May 30, 2010
Messages
15
Hello,
necessary, consult the following scripts

in cells is by using conditional formatting nastevena condition:
1 if the value is greater than 10 red cell will be
2, where the lower green

Need data to other cells when the code will write a condition in a cell "OK" if the condition of two write "NOK"

I tried using ForeColor, but somehow it did not work

I have many such cells, therefore, to try it this way, you can help me? thank
Bez_n_zvu.png
 
I don't think that you can do this with a worksheet formula. I think that you will need to write a function and test Interior.colorindex, but even there I have a feeling that this runs into problems with conditional formatting.
Can you not test the condition that the formatting is based on.

Brian
 
i try this code :
If Me.[teplota_prac].BackColor = RGB(237, 28, 36) Then
Me.[zhodnotenie].Value = "Ok"
End If

and not working :(
 
Do it on the On_Current event of the FORM and on the After_Insert and After_Update events of the TEXTBOX. Also, check it against vbRed:
Code:
If Me.[teplota_prac].BackColor = vbRed Then
    Me.[zhodnotenie].[COLOR=Red][B]Caption[/B][/COLOR] = "Ok"
Else
    Me.[zhodnotenie].[COLOR=Red][B]Caption[/B][/COLOR] = "Nok"
End If
I'm guessing [zhodnotenie] is a LABEL and not a TEXTBOX?
 
:o

with the post mentioning cells I thought it was an Excel question.
I think maybe the sun is getting to me. :(

Brian
 
:o

with the post mentioning cells I thought it was an Excel question.
I think maybe the sun is getting to me. :(

Brian
Haha! Or too much football Brian. ;)

I reckon the image didn't load up when you first saw the post. He did say cells but when I saw the image it was certainly Access.
 
i try code :
If Me.[teplota_prac].BackColor = RGB(237, 28, 36) Then
Me.[zhodnotenie].Value = "Nok"
Else
Me.[zhodnotenie].Value = "Ok"
End If

and cell [zhodnotenie] is still "Ok"

here is attachment :
 

Attachments

I think you are going about this the wrong way. You should just use the same formulas as does the conditional formatting, not trying to get whether the RGB color is something. One number off and it is not going to work.

Just use the same formulas that you've used in the conditional formatting to determine the value of the text.
 
I think you are going about this the wrong way. You should just use the same formulas as does the conditional formatting, not trying to get whether the RGB color is something. One number off and it is not going to work.

Just use the same formulas that you've used in the conditional formatting to determine the value of the text.

Hey! I did suggest that even if I( was thinking Excel, see I'm a genius really, not mad. :D

Brian
 
Hey where did you get that picture from my modelling days?

On a more serious note i seem to remember that in Excel conditional formatting takes place at display but does not cause a change to the original Interior.Colorindex, I don't know whether this is the same in ACCESS but using the original tests seems the simple way.


Brian
 

Users who are viewing this thread

Back
Top Bottom