Formatting calculated control on a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I'm having trouble figuring out how to format a calculated control on my
form. The control is in the form footer and is the sum of the detail values.
I would like the formatting on this control to be in red if the value is not
100 and black otherwise. The help in Access (I'm on A97) only gives a
positive,negative,zero,Null formatting
options (i.e. [Red]#,###.##;[Red]-_#,###.##;[Black]0.00;"error"). Is this
doable?
 
Since it's in the footer, you should be able to set the colour
programmatically (try the form's Current event).

If Me.txtMySum <> 100 Then
Me.txtMySum.ForeColor = vbRed
Else
Me.txtMySum.ForeColor = vbBlack
End If
 
I would have bet you a million bucks that I had already tried that without
success, but I guess I'd be a lot poorer now. Thanks!



Douglas J. Steele said:
Since it's in the footer, you should be able to set the colour
programmatically (try the form's Current event).

If Me.txtMySum <> 100 Then
Me.txtMySum.ForeColor = vbRed
Else
Me.txtMySum.ForeColor = vbBlack
End If

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


kabaka said:
Hi All,

I'm having trouble figuring out how to format a calculated control on my
form. The control is in the form footer and is the sum of the detail
values.
I would like the formatting on this control to be in red if the value is
not
100 and black otherwise. The help in Access (I'm on A97) only gives a
positive,negative,zero,Null formatting
options (i.e. [Red]#,###.##;[Red]-_#,###.##;[Black]0.00;"error"). Is this
doable?
 
I'll settle for 1%! <g>

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


kabaka said:
I would have bet you a million bucks that I had already tried that without
success, but I guess I'd be a lot poorer now. Thanks!



Douglas J. Steele said:
Since it's in the footer, you should be able to set the colour
programmatically (try the form's Current event).

If Me.txtMySum <> 100 Then
Me.txtMySum.ForeColor = vbRed
Else
Me.txtMySum.ForeColor = vbBlack
End If

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


kabaka said:
Hi All,

I'm having trouble figuring out how to format a calculated control on
my
form. The control is in the form footer and is the sum of the detail
values.
I would like the formatting on this control to be in red if the value
is
not
100 and black otherwise. The help in Access (I'm on A97) only gives a
positive,negative,zero,Null formatting
options (i.e. [Red]#,###.##;[Red]-_#,###.##;[Black]0.00;"error"). Is
this
doable?
 
Back
Top