#Error

M

Mark K

This is probably simple fix but I'm at a loss.

I am running a report based on a query that list tickets
[PROBLEM_ID] and it related fields based on a certain
criteria. The tickets are grouped by the Plan [PLAN] they
reside under with header and footer. In the [PLAN] footer
I am calculating a simple Count of the number of
[PROBLEM_ID] under each plan: =Count([PROBLEM_ID]). The
report runs fine when tickets are listed but I receive
an '#Error' in the [PLAN] footer calculating txtbox when
nothing is listed when I need it to report '0'. I have
tried IsNull, IsError, and IIf statements. What am I
missing?
 
M

Marshall Barton

Mark said:
I am running a report based on a query that list tickets
[PROBLEM_ID] and it related fields based on a certain
criteria. The tickets are grouped by the Plan [PLAN] they
reside under with header and footer. In the [PLAN] footer
I am calculating a simple Count of the number of
[PROBLEM_ID] under each plan: =Count([PROBLEM_ID]). The
report runs fine when tickets are listed but I receive
an '#Error' in the [PLAN] footer calculating txtbox when
nothing is listed when I need it to report '0'. I have
tried IsNull, IsError, and IIf statements. What am I
missing?


It sort of looks like you have the count text box in a
subreport??

If that's not what you have, pleas post back with more
details about the report, especially the report's record
source query, some sample data that demonstrates the problem
along with a short example of the report's output.
 
M

Mark K

No there is no subreport in this report. It's basically
giving me and #Error when there is no data being pulled
from the query.
-----Original Message-----
Mark said:
I am running a report based on a query that list tickets
[PROBLEM_ID] and it related fields based on a certain
criteria. The tickets are grouped by the Plan [PLAN] they
reside under with header and footer. In the [PLAN] footer
I am calculating a simple Count of the number of
[PROBLEM_ID] under each plan: =Count([PROBLEM_ID]). The
report runs fine when tickets are listed but I receive
an '#Error' in the [PLAN] footer calculating txtbox when
nothing is listed when I need it to report '0'. I have
tried IsNull, IsError, and IIf statements. What am I
missing?


It sort of looks like you have the count text box in a
subreport??

If that's not what you have, pleas post back with more
details about the report, especially the report's record
source query, some sample data that demonstrates the problem
along with a short example of the report's output.
 
M

Marshall Barton

Mark said:
No there is no subreport in this report. It's basically
giving me and #Error when there is no data being pulled
from the query.


I must be missing something here. If a group has no records
there will be no group, no header, no footer, no details,
thus nothing to display #Error. There must be something
going on here that I don't have enough details to see.



-----Original Message-----
Mark said:
I am running a report based on a query that list tickets
[PROBLEM_ID] and it related fields based on a certain
criteria. The tickets are grouped by the Plan [PLAN] they
reside under with header and footer. In the [PLAN] footer
I am calculating a simple Count of the number of
[PROBLEM_ID] under each plan: =Count([PROBLEM_ID]). The
report runs fine when tickets are listed but I receive
an '#Error' in the [PLAN] footer calculating txtbox when
nothing is listed when I need it to report '0'. I have
tried IsNull, IsError, and IIf statements. What am I
missing?
Marshall said:
It sort of looks like you have the count text box in a
subreport??

If that's not what you have, pleas post back with more
details about the report, especially the report's record
source query, some sample data that demonstrates the
problem along with a short example of the report's output.
 
M

Mick Ruthven

I get the same thing, and always have with Access. Just a simple report, no
groups, no totals. If the data source query doesn't return any records, of
it there's a report filter that prevents any records from appearing, the
report puts "error" on the report. That a very inelegant way of saying "no
records selected" or some other message. How can we get rid of that "error"
notation and instead provide our own message.

Thanks,

Mick Ruthven
 
M

Marshall Barton

Mick said:
I get the same thing, and always have with Access. Just a simple report, no
groups, no totals. If the data source query doesn't return any records, of
it there's a report filter that prevents any records from appearing, the
report puts "error" on the report. That a very inelegant way of saying "no
records selected" or some other message. How can we get rid of that "error"
notation and instead provide our own message.

Slapping self up side da head and screaming DUMMY three
times. Ok, now I got it. There are no records for the
entire report! (I thought we were dealing with a report
that had data and trying to display a nonexistent group
total :-(

Use the report's NoData event to make the controls you don't
want to see (at least the one with #Error) invisible and
whatever you do want to see (a label with a caption of 0)
Visible.

Sub Report_NoData( . . .
Me.Section(0).Visible = False 'probably don't want detail
Me.Section(5).Visible = False 'or group header
Me.Detail.Visible = False 'probably don't want detail
Me.thetotaltextbox.Visible = False
. . .
Me.thezerolabel.Visible = True
. . .
End Sub

Like you said, not elegant, but it is flexible ;-)
 

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