bold only if less than 95% in report

L

Louie

I have been working on a report the new request is to have the percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
R

RonaldoOneNil

With your report in design view and the relevant box highlighted
Click on Format - Conditional Formatting on the menubar
Select field value is less than 95 and then click the Bold button
Click OK and test the report
 
A

Al Campagna

Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays in the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
L

Louie

What if it is 97 Access LOL

RonaldoOneNil said:
With your report in design view and the relevant box highlighted
Click on Format - Conditional Formatting on the menubar
Select field value is less than 95 and then click the Bold button
Click OK and test the report

Louie said:
I have been working on a report the new request is to have the percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
L

Louie

That worked gr8t Now how about another set - this is what i tried but I got
an error and it wont even preview the report

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True

End If

End Sub

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

If Text25 < 2# Then
Text25.FontBold = False
Else
Text25.FontBold = True

End If

End Sub

Al Campagna said:
Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays in the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


Louie said:
I have been working on a report the new request is to have the percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
A

Al Campagna

Louie,
You wrote...
this is what i tried but I got an error.
Care to describe and share that error with us?

Your first code... as you wrote it... works fine for a calculated text
control named
PercMinStd, in GroupHeader1, with values above and below .95.
So... you have some other problem.

This code tested OK...
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If
End Sub

All I can suggest is to check your object names (field, group)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Louie said:
That worked gr8t Now how about another set -
an error and it wont even preview the report

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True

End If

End Sub

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

If Text25 < 2# Then
Text25.FontBold = False
Else
Text25.FontBold = True

End If

End Sub

Al Campagna said:
Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays in
the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


Louie said:
I have been working on a report the new request is to have the
percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
L

Louie

Well (see below) instead of bold they want it to be Red - I told them it cant
be done in Access 97 but they are pushing me on getting it done that way - Is
it possible?

This is what I ended up using for the bold- Thank you for your help

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If

If PercScrp < 0.02 Then
PercScrp.FontBold = False
Else
PercScrp.FontBold = True

End If

End Sub


Al Campagna said:
Louie,
You wrote...
this is what i tried but I got an error.
Care to describe and share that error with us?

Your first code... as you wrote it... works fine for a calculated text
control named
PercMinStd, in GroupHeader1, with values above and below .95.
So... you have some other problem.

This code tested OK...
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If
End Sub

All I can suggest is to check your object names (field, group)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Louie said:
That worked gr8t Now how about another set -
an error and it wont even preview the report

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True

End If

End Sub

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

If Text25 < 2# Then
Text25.FontBold = False
Else
Text25.FontBold = True

End If

End Sub

Al Campagna said:
Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays in
the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


I have been working on a report the new request is to have the
percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
L

Louie

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd >= 0.95 Then
PercMinStnd.ForeColor = 0 = False

Else
PercMinStnd.ForeColor = 255 = True

End If

This is what I have tried so far without the true and false it does change
all of my font colors to red but the above displays black only.



Louie said:
Well (see below) instead of bold they want it to be Red - I told them it cant
be done in Access 97 but they are pushing me on getting it done that way - Is
it possible?

This is what I ended up using for the bold- Thank you for your help

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If

If PercScrp < 0.02 Then
PercScrp.FontBold = False
Else
PercScrp.FontBold = True

End If

End Sub


Al Campagna said:
Louie,
You wrote...
this is what i tried but I got an error.
Care to describe and share that error with us?

Your first code... as you wrote it... works fine for a calculated text
control named
PercMinStd, in GroupHeader1, with values above and below .95.
So... you have some other problem.

This code tested OK...
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If
End Sub

All I can suggest is to check your object names (field, group)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Louie said:
That worked gr8t Now how about another set -
an error and it wont even preview the report

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True

End If

End Sub

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

If Text25 < 2# Then
Text25.FontBold = False
Else
Text25.FontBold = True

End If

End Sub

:

Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays in
the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


I have been working on a report the new request is to have the
percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
A

Al Campagna

For >= .095 = Black or <.095 = Red...
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd >= 0.95 Then
PercMinStnd.ForeColor = QBColor(0)
Else
PercMinStnd.ForeColor = QBColor(12)
End If
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


Louie said:
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd >= 0.95 Then
PercMinStnd.ForeColor = 0 = False

Else
PercMinStnd.ForeColor = 255 = True

End If

This is what I have tried so far without the true and false it does change
all of my font colors to red but the above displays black only.



Louie said:
Well (see below) instead of bold they want it to be Red - I told them it
cant
be done in Access 97 but they are pushing me on getting it done that
way - Is
it possible?

This is what I ended up using for the bold- Thank you for your help

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As
Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If

If PercScrp < 0.02 Then
PercScrp.FontBold = False
Else
PercScrp.FontBold = True

End If

End Sub


Al Campagna said:
Louie,
You wrote...
this is what i tried but I got an error.
Care to describe and share that error with us?

Your first code... as you wrote it... works fine for a calculated
text
control named
PercMinStd, in GroupHeader1, with values above and below .95.
So... you have some other problem.

This code tested OK...
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As
Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If
End Sub

All I can suggest is to check your object names (field, group)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

That worked gr8t Now how about another set -
an error and it wont even preview the report

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As
Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True

End If

End Sub

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

If Text25 < 2# Then
Text25.FontBold = False
Else
Text25.FontBold = True

End If

End Sub

:

Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays
in
the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


I have been working on a report the new request is to have the
percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct
percentage

=[txtPcsPerHour]/[MinProductionRate]
 
J

John Spencer MVP

You might try

If PercMinStnd >= 0.95 Then
PercMinStnd.ForeColor = vbRed
Else
PercMinStnd.ForeColor = vbBlack
End If


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd >= 0.95 Then
PercMinStnd.ForeColor = 0 = False

Else
PercMinStnd.ForeColor = 255 = True

End If

This is what I have tried so far without the true and false it does change
all of my font colors to red but the above displays black only.



Louie said:
Well (see below) instead of bold they want it to be Red - I told them it cant
be done in Access 97 but they are pushing me on getting it done that way - Is
it possible?

This is what I ended up using for the bold- Thank you for your help

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If

If PercScrp < 0.02 Then
PercScrp.FontBold = False
Else
PercScrp.FontBold = True

End If

End Sub


Al Campagna said:
Louie,
You wrote...
this is what i tried but I got an error.
Care to describe and share that error with us?

Your first code... as you wrote it... works fine for a calculated text
control named
PercMinStd, in GroupHeader1, with values above and below .95.
So... you have some other problem.

This code tested OK...
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True
End If
End Sub

All I can suggest is to check your object names (field, group)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

That worked gr8t Now how about another set -
an error and it wont even preview the report

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If PercMinStnd > 0.95 Then
PercMinStnd.FontBold = False
Else
PercMinStnd.FontBold = True

End If

End Sub

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

If Text25 < 2# Then
Text25.FontBold = False
Else
Text25.FontBold = True

End If

End Sub

:

Louie,
Use the OnFormat event of the Report, in the section where your
percentage is located, to bold or unbold that value.
If that calculated field was named [FinalPct]... and it displays in
the
Detail section...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FinalPct > .95 Then
FinalPct.FontBold = False
Else
FinalPct.FontBold = True
End if
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


I have been working on a report the new request is to have the
percentage
rate bolded only if it is lower than 95% - is this possible?

This is what I have right now and it give me the correct percentage

=[txtPcsPerHour]/[MinProductionRate]
 
Top