Formatting calculated control on a Form

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?
 
D

Douglas J. Steele

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
 
G

Guest

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?
 
D

Douglas J. Steele

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?
 

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