A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

on no data - need to show SOMETHING



 
 
Thread Tools Display Modes
  #1  
Old November 15th, 2005, 08:14 PM
DavPet
external usenet poster
 
Posts: n/a
Default on no data - need to show SOMETHING

I have a group of 5 reports. 3 of the 5 often have nothing to report.
I use Cancel=True in the On NoData event for the reports because whene there
is no data, several of the report fields say "Error".
I want the report to print the phrase "No data for this report" and not see
any of the errors in the empy fields.

How ??


  #2  
Old November 15th, 2005, 08:52 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default on no data - need to show SOMETHING

DavPet wrote:

I have a group of 5 reports. 3 of the 5 often have nothing to report.
I use Cancel=True in the On NoData event for the reports because whene there
is no data, several of the report fields say "Error".
I want the report to print the phrase "No data for this report" and not see
any of the errors in the empy fields.



Using the NoData event to cancel a subreport has no
signiicant effect because a subreport with no data will not
do anything.

A mainreport text box can check if a subreport has no data
and display whatever you want by using an expression like:

=IIf(subreport.Report.HasData,
subreport.Report.subreporttextbox, "No data for this
report")

--
Marsh
MVP [MS Access]
  #3  
Old November 15th, 2005, 09:53 PM
DavPet
external usenet poster
 
Posts: n/a
Default on no data - need to show SOMETHING


"Marshall Barton" wrote in message
...
DavPet wrote:

I have a group of 5 reports. 3 of the 5 often have nothing to report.
I use Cancel=True in the On NoData event for the reports because whene
there
is no data, several of the report fields say "Error".
I want the report to print the phrase "No data for this report" and not
see
any of the errors in the empy fields.



Using the NoData event to cancel a subreport has no
signiicant effect because a subreport with no data will not
do anything.


These are not subreports but 5 separate reports printed as a group.


A mainreport text box can check if a subreport has no data
and display whatever you want by using an expression like:

=IIf(subreport.Report.HasData,
subreport.Report.subreporttextbox, "No data for this
report")

--
Marsh
MVP [MS Access]



  #4  
Old November 16th, 2005, 12:44 AM
tina
external usenet poster
 
Posts: n/a
Default on no data - need to show SOMETHING

so you want a page to print for a report even if there is no data? if so,
here's one solution:

in each report's Design view, add a Label control, i'll call it "Label6".
you'll have to type something in it so it will "stick" - it doesn't matter
what. in the Properties box, set the label's Visible property to No.
in each report's NoData event procedure, remove the "Cancel = True" code.
replace it with the following, as

Dim ctrl As Control

For Each ctrl In Me.Controls
If ctrl.Name = "Label6" Then
ctrl.Caption = Me.Caption & " has no data."
ctrl.Visible = True
Else
ctrl.Visible = False
End If
Next ctrl

if there's no data, all controls in the report will be hidden, and the
Label6 control will be unhidden. the report will print (or preview)
normally.

hth


"DavPet" wrote in message
...

"Marshall Barton" wrote in message
...
DavPet wrote:

I have a group of 5 reports. 3 of the 5 often have nothing to report.
I use Cancel=True in the On NoData event for the reports because whene
there
is no data, several of the report fields say "Error".
I want the report to print the phrase "No data for this report" and not
see
any of the errors in the empy fields.



Using the NoData event to cancel a subreport has no
signiicant effect because a subreport with no data will not
do anything.


These are not subreports but 5 separate reports printed as a group.


A mainreport text box can check if a subreport has no data
and display whatever you want by using an expression like:

=IIf(subreport.Report.HasData,
subreport.Report.subreporttextbox, "No data for this
report")

--
Marsh
MVP [MS Access]





  #5  
Old November 16th, 2005, 04:21 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default on no data - need to show SOMETHING

Thanks. This is what I wanted.


"tina" wrote in message
...
so you want a page to print for a report even if there is no data? if so,
here's one solution:

in each report's Design view, add a Label control, i'll call it "Label6".
you'll have to type something in it so it will "stick" - it doesn't matter
what. in the Properties box, set the label's Visible property to No.
in each report's NoData event procedure, remove the "Cancel = True" code.
replace it with the following, as

Dim ctrl As Control

For Each ctrl In Me.Controls
If ctrl.Name = "Label6" Then
ctrl.Caption = Me.Caption & " has no data."
ctrl.Visible = True
Else
ctrl.Visible = False
End If
Next ctrl

if there's no data, all controls in the report will be hidden, and the
Label6 control will be unhidden. the report will print (or preview)
normally.

hth


"DavPet" wrote in message
...

"Marshall Barton" wrote in message
...
DavPet wrote:

I have a group of 5 reports. 3 of the 5 often have nothing to report.
I use Cancel=True in the On NoData event for the reports because whene
there
is no data, several of the report fields say "Error".
I want the report to print the phrase "No data for this report" and not
see
any of the errors in the empy fields.


Using the NoData event to cancel a subreport has no
signiicant effect because a subreport with no data will not
do anything.


These are not subreports but 5 separate reports printed as a group.


A mainreport text box can check if a subreport has no data
and display whatever you want by using an expression like:

=IIf(subreport.Report.HasData,
subreport.Report.subreporttextbox, "No data for this
report")

--
Marsh
MVP [MS Access]







  #6  
Old November 16th, 2005, 06:10 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default on no data - need to show SOMETHING

you're welcome


"DavPet" wrote in message
...
Thanks. This is what I wanted.


"tina" wrote in message
...
so you want a page to print for a report even if there is no data? if

so,
here's one solution:

in each report's Design view, add a Label control, i'll call it

"Label6".
you'll have to type something in it so it will "stick" - it doesn't

matter
what. in the Properties box, set the label's Visible property to No.
in each report's NoData event procedure, remove the "Cancel = True"

code.
replace it with the following, as

Dim ctrl As Control

For Each ctrl In Me.Controls
If ctrl.Name = "Label6" Then
ctrl.Caption = Me.Caption & " has no data."
ctrl.Visible = True
Else
ctrl.Visible = False
End If
Next ctrl

if there's no data, all controls in the report will be hidden, and the
Label6 control will be unhidden. the report will print (or preview)
normally.

hth


"DavPet" wrote in message
...

"Marshall Barton" wrote in message
...
DavPet wrote:

I have a group of 5 reports. 3 of the 5 often have nothing to

report.
I use Cancel=True in the On NoData event for the reports because

whene
there
is no data, several of the report fields say "Error".
I want the report to print the phrase "No data for this report" and

not
see
any of the errors in the empy fields.


Using the NoData event to cancel a subreport has no
signiicant effect because a subreport with no data will not
do anything.

These are not subreports but 5 separate reports printed as a group.

A mainreport text box can check if a subreport has no data
and display whatever you want by using an expression like:

=IIf(subreport.Report.HasData,
subreport.Report.subreporttextbox, "No data for this
report")

--
Marsh
MVP [MS Access]








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I save an access document in word document? cmartin General Discussion 2 September 13th, 2005 11:26 PM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Worksheet Functions 7 September 3rd, 2005 03:47 PM
Unable to have multiple queries feeding a single report PZ Straube Setting Up & Running Reports 15 June 15th, 2005 08:16 AM
strategy for data entry in multiple tables LAF Using Forms 18 April 25th, 2005 04:04 AM
How to create graphs in a monthly report where the base data can change John Clarke Charts and Charting 3 June 25th, 2004 02:22 AM


All times are GMT +1. The time now is 12:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.