Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 21st, 2005, 01:03 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default Display subreport with no underlying data

I have a report that I am generating with 5 subreports embedded in it. When one of the queries that the subreports are generated from has no data, the subreport does not show when I run the main report. I would like all subreports to be displayed, regardless if there is underlying data or not. I have tried using the Details section of the main report and setting all of my subreports' visible property to True using VB, but this is still not working. Any suggestions?

Reply With Quote
  #2 (permalink)  
Old March 22nd, 2005, 08:37 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Display a message in the place where the subreport should be stating that there is no data.

mmcdonal
Reply With Quote
  #3 (permalink)  
Old March 22nd, 2005, 08:50 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Also, when you placed your subreport into your report at design time, it had a label. Having the label showing above the spot where the data goes with no data is also an indicator that "X marks the spot."


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old March 22nd, 2005, 01:47 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks for the suggestions. Unfortunately I need the subreports to show up because I have a text box on each subreport footer that sums the data for each subreport. Then I have a totals box on the main report that totals all the 5 subreport totals boxes. I have those to be set to 0 if there is no data in the subreport, so I'm getting an error on the totals box on my main report because it's looking for the text boxes and not finding some of them. I know there's a way to use hasdata with an if statement but that seemed like a lot of coding and it would be easier if the subreport would just show up with a zero on it instead of hard coding all of my summation boxes.

Reply With Quote
  #5 (permalink)  
Old April 11th, 2005, 04:08 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

BPH, Have you found a solution to this problem? I have the same problem. One of my parameters is MTD/WTD. If MTD I determine the start / end date for the month and pass that to my subreports. The main report displays daily information but there may be no data for the day but I still want the subreports to display the monthly information.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Underlying connection was closed r_ganesh76 .NET Web Services 0 May 4th, 2006 04:49 AM
No data in subreport error jesseleon Access VBA 6 December 28th, 2005 08:58 AM
Subreport not displaying no data message in main lic023 Access 0 March 15th, 2005 08:15 AM
Can Main and SubReport get data fr different table yblee Crystal Reports 0 August 19th, 2004 03:37 AM
SubReport in data report vb6? stupidz VB Databases Basics 0 March 1st, 2004 04:18 AM



All times are GMT -4. The time now is 06:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.