View Full Version : Conditional Formatting Revisited


RexesOperator
10-28-2007, 06:25 PM
I should mention I'm using A2K.

The problem I have now, is that I need to use the conditional formatting on 19 fields in the detail section. These fields are independent of each other, so a case statement is not applicable. And they have different test conditions. They are all numeric types.

When I try to add:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If textfield1 < 0 Then
textfield1.Visible = True
End If

If textfield2 > -99 Then
textfield2.BorderStyle.Visible = True
End If

End Sub

I get a run-time error '424'
Object required

WayneRyan
10-28-2007, 08:37 PM
RO,

This line:

textfield2.BorderStyle.Visible = True

can't be done. The .BorderStyle property doesn't have a Visible value.

You can only select a .BorderStyle type with a numeric argument:

Me.textfield2.BorderStyle = 0 <-- Transparent
Me.textfield2.BorderStyle = 1 <-- Solid

Wayne

RexesOperator
10-28-2007, 08:56 PM
Thank you! - Waiting for the end of the World Series?

WayneRyan
10-28-2007, 09:01 PM
Rex,

Glad to help.

Yes, wasn't in any pools ... saw no reason to watch the last game.

It was the last wasn't it?

See ya,
Wayne

RexesOperator
10-29-2007, 06:30 AM
Yes it was the last - Boston in 4.

GaryPanic
11-14-2007, 12:12 PM
I have the same problem, my controls are not bound and there no 'conditional formating' under the format tab in the properties of my controls.
I use a form with a couple of combos' to display a record in text boxes.
What I would like to do is to change the font color to red of one my textboxes when it displays the word "FORBIDDEN".
I'm at a total loss here...


if textbox = "Forbidden" then textbox. ForeColor = 255
esle textbox.forecolur =0( I think)