Conditional Formatting Problem

G

Guest

My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray. I apologize for the lengthy email and I
appreciate your time. Thanks!

Ortley
 
G

Guest

I'm not sure what you are attempting to do or why. I am sure that the name
"name" can cause issues since [Name] may be returning the name of the report
rather than the control named name that might be bound to the field named
name. Type may cause similar issues.

I would start trouble-shooting by renaming name to something more explicit
and less reserved.
 
M

Marshall Barton

Ortley said:
My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray.


Sounds like you are trying to hide a problem's consequences
instead of dealing with the problem. Why are you printing a
report when there is no data for the report to display.

You can use the report's NoData event to cancel the report.
 
G

Guest

Marsh,

Thanks for your reply. I created the report because it is used as a
subreport in a calendar I created. When there are no appointments scheduled,
I'd like to see an empty space instead of a "1".

Marshall Barton said:
Ortley said:
My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray.


Sounds like you are trying to hide a problem's consequences
instead of dealing with the problem. Why are you printing a
report when there is no data for the report to display.

You can use the report's NoData event to cancel the report.
 
G

Guest

Thanks for your reply Duane. I read one of your replies to another post and
already tried this. The report is used as a subreport in a calendar. The
names get listed in a date block on the calendar to show who is scheduled.
When I have no clients visiting, I'd like to see a blank calendar space
instead of a "1" in it. Thanks for your support.

Ortley

Duane Hookom said:
I'm not sure what you are attempting to do or why. I am sure that the name
"name" can cause issues since [Name] may be returning the name of the report
rather than the control named name that might be bound to the field named
name. Type may cause similar issues.

I would start trouble-shooting by renaming name to something more explicit
and less reserved.

--
Duane Hookom
Microsoft Access MVP


Ortley said:
My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray. I apologize for the lengthy email and I
appreciate your time. Thanks!

Ortley
 
G

Guest

I don't understand where the "1" is coming from. If your subreport doesn't
have any records, it will not display.

I also don't know what you tried. Did you try renaming you fields in the
record source as well as the controls?

--
Duane Hookom
Microsoft Access MVP


Ortley said:
Thanks for your reply Duane. I read one of your replies to another post and
already tried this. The report is used as a subreport in a calendar. The
names get listed in a date block on the calendar to show who is scheduled.
When I have no clients visiting, I'd like to see a blank calendar space
instead of a "1" in it. Thanks for your support.

Ortley

Duane Hookom said:
I'm not sure what you are attempting to do or why. I am sure that the name
"name" can cause issues since [Name] may be returning the name of the report
rather than the control named name that might be bound to the field named
name. Type may cause similar issues.

I would start trouble-shooting by renaming name to something more explicit
and less reserved.

--
Duane Hookom
Microsoft Access MVP


Ortley said:
My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray. I apologize for the lengthy email and I
appreciate your time. Thanks!

Ortley
 
M

Marshall Barton

A subreport with no data will not display anything so I
conclude that your table/query actually has a 1 in it. Try
running the record source query directly from the query
design window or open the table in sheet view to see if you
can find the record with a 1.
--
Marsh
MVP [MS Access]

Thanks for your reply. I created the report because it is used as a
subreport in a calendar I created. When there are no appointments scheduled,
I'd like to see an empty space instead of a "1".

Marshall Barton said:
Ortley said:
My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray.


Sounds like you are trying to hide a problem's consequences
instead of dealing with the problem. Why are you printing a
report when there is no data for the report to display.

You can use the report's NoData event to cancel the report.
 
G

Guest

Duane,

The "1" is coming from the the text box (named text13), which has a control
source =1 and a running sum Over All. This functions like an autonumber for
each record listed.

Duane Hookom said:
I don't understand where the "1" is coming from. If your subreport doesn't
have any records, it will not display.

I also don't know what you tried. Did you try renaming you fields in the
record source as well as the controls?

--
Duane Hookom
Microsoft Access MVP


Ortley said:
Thanks for your reply Duane. I read one of your replies to another post and
already tried this. The report is used as a subreport in a calendar. The
names get listed in a date block on the calendar to show who is scheduled.
When I have no clients visiting, I'd like to see a blank calendar space
instead of a "1" in it. Thanks for your support.

Ortley

Duane Hookom said:
I'm not sure what you are attempting to do or why. I am sure that the name
"name" can cause issues since [Name] may be returning the name of the report
rather than the control named name that might be bound to the field named
name. Type may cause similar issues.

I would start trouble-shooting by renaming name to something more explicit
and less reserved.

--
Duane Hookom
Microsoft Access MVP


:

My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray. I apologize for the lengthy email and I
appreciate your time. Thanks!

Ortley
 
G

Guest

The text box (named text13), has a control source =1 and a running sum Over
All. This functions as an autonumber and is the source of the "1" When
subsequent records are listed, they are numbered as well.

Marshall Barton said:
A subreport with no data will not display anything so I
conclude that your table/query actually has a 1 in it. Try
running the record source query directly from the query
design window or open the table in sheet view to see if you
can find the record with a 1.
--
Marsh
MVP [MS Access]

Thanks for your reply. I created the report because it is used as a
subreport in a calendar I created. When there are no appointments scheduled,
I'd like to see an empty space instead of a "1".

Marshall Barton said:
Ortley wrote:

My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray.


Sounds like you are trying to hide a problem's consequences
instead of dealing with the problem. Why are you printing a
report when there is no data for the report to display.

You can use the report's NoData event to cancel the report.
 
M

Marshall Barton

Then the subreport must have a record that has no data in
the fields displayed on the report. You need to look at the
data in the subreport's record source to see where that data
is coming from. Maybe the table has blank records, or maybe
the record source is a query that uses an outer join with no
matching record or maybe it's something else???
--
Marsh
MVP [MS Access]

The text box (named text13), has a control source =1 and a running sum Over
All. This functions as an autonumber and is the source of the "1" When
subsequent records are listed, they are numbered as well.

Marshall Barton said:
A subreport with no data will not display anything so I
conclude that your table/query actually has a 1 in it. Try
running the record source query directly from the query
design window or open the table in sheet view to see if you
can find the record with a 1.

Thanks for your reply. I created the report because it is used as a
subreport in a calendar I created. When there are no appointments scheduled,
I'd like to see an empty space instead of a "1".

:

Ortley wrote:

My intent is to apply conditional formatting to a text box when a control in
the same detail is blank. The text box (named text13), has a control source
=1 and a running sum Over All. The text boxes to the right are both named
Name and Type and have control sources of [Name] and [Type] respectively.
All data comes from the same query and all text boxes are in the detail
section of the same report named rptJuneTest.

For example, the report, when there are no null values may look like this (I
formatted the text boxes light gray, so the report shows rows of gray):

1 John Smith Property Damage
2 Kevin White Wrongful Death
3 Peter Jones Weapons Confiscation

When I run the report and I have no names listed, here is what the report
looks like:

1

Also, the "1" above as well as the spaces to the right are all shaded in
gray. My intent is to show a completely blank space when I run the report
with no "1" and no gray shading at all.

I applied conditional formatting to the [Name] and [Type] field to be shaded
white using the expression:

Expression is ""

This works and when I run the report, the gray shading is removed and the
space is blank. I tried using the expression [Name] Is Null for text13, but
it remained shaded with gray.


Sounds like you are trying to hide a problem's consequences
instead of dealing with the problem. Why are you printing a
report when there is no data for the report to display.

You can use the report's NoData event to cancel the report.
 

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