Conditional Formatting

A

Allen

Is ther any way to add more than 3 conditions for
conditional formatting.

This is what I have:
I have a form with a subform with continuas View. You can
dblclick items on the subform and it will open another
form so you can edit the information. Well I have a
option group 1-7. Depending on the option selected a text
box on the form will change colors. The problem I am
having is when I have more than one item showing on the
subform when one of the times has focus the rest of the
items are the same color. When I change focus to another
item the rest changes to the same color as that. What I
want is all the items to show what colors they suppose to
be, and that is differant and not the same color. This is
my code, and i put it in the current event on the subform.

Private Sub Form_Current()

If [OPS] = 1 Then
[TBC].Visible = False
End If
If [OPS] = 2 Then
[TBC].BackColor = 13434828
[TBC].Visible = True
End If
If [OPS] = 3 Then
[TBC].BackColor = 9868950
[TBC].Visible = True
End If
If [OPS] = 4 Then
[TBC].BackColor = 52479
[TBC].Visible = True
End If
If [OPS] = 5 Then
[TBC].BackColor = 16751052
[TBC].Visible = True
End If
If [OPS] = 6 Then
[TBC].BackColor = 13421619
[TBC].Visible = True
End If
If [OPS] = 7 Then
[TBC].BackColor = 65535
[TBC].Visible = True
End If


End Sub

Can any body help. I don't think Conditional Formatting
will help, it only supports up to 3 items, I need up to 7
Items, and on one of the items I need to make the textbox
[TBC] visible False.

Thanks Allen
 
T

Terry

There is an excellent article about this on one of the
MSVP's sites, I've forgotten which one. Anybody else help
here???
Terry
 
S

Stephen Lebans

There's sample code on my site showing you how to programmatically
manipulate the FormatConditions object but you cannot have more than 3
preset conditions.
http://www.lebans.com/conditionalformatting.htm
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Terry said:
There is an excellent article about this on one of the
MSVP's sites, I've forgotten which one. Anybody else help
here???
Terry
-----Original Message-----
Is ther any way to add more than 3 conditions for
conditional formatting.

This is what I have:
I have a form with a subform with continuas View. You can
dblclick items on the subform and it will open another
form so you can edit the information. Well I have a
option group 1-7. Depending on the option selected a text
box on the form will change colors. The problem I am
having is when I have more than one item showing on the
subform when one of the times has focus the rest of the
items are the same color. When I change focus to another
item the rest changes to the same color as that. What I
want is all the items to show what colors they suppose to
be, and that is differant and not the same color. This is
my code, and i put it in the current event on the subform.

Private Sub Form_Current()

If [OPS] = 1 Then
[TBC].Visible = False
End If
If [OPS] = 2 Then
[TBC].BackColor = 13434828
[TBC].Visible = True
End If
If [OPS] = 3 Then
[TBC].BackColor = 9868950
[TBC].Visible = True
End If
If [OPS] = 4 Then
[TBC].BackColor = 52479
[TBC].Visible = True
End If
If [OPS] = 5 Then
[TBC].BackColor = 16751052
[TBC].Visible = True
End If
If [OPS] = 6 Then
[TBC].BackColor = 13421619
[TBC].Visible = True
End If
If [OPS] = 7 Then
[TBC].BackColor = 65535
[TBC].Visible = True
End If


End Sub

Can any body help. I don't think Conditional Formatting
will help, it only supports up to 3 items, I need up to 7
Items, and on one of the items I need to make the textbox
[TBC] visible False.

Thanks Allen

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top