473,652 Members | 3,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What to do with an empty query in a report?

I have a report that runs on a parameter query. I run the report, enter the
parameter, and it works as long as there is at least one record returned by
the query. But if it comes up empty, I get an error in the report. I think
there is some way to query the query to see if it's got any records and then
exit the report. How is this done?

Robert
Nov 12 '05 #1
2 2064
Robert wrote:
I have a report that runs on a parameter query. I run the report, enter the
parameter, and it works as long as there is at least one record returned by
the query. But if it comes up empty, I get an error in the report. I think
there is some way to query the query to see if it's got any records and then
exit the report. How is this done?

Robert


See if setting the event procedure for the Report's OnNoData event to
something will help. Ex:

Private Sub Report_NoData(C ancel As Integer)
msgbox "Nothing to report"
Cancel = True
End Sub

Nov 12 '05 #2

Perfect! Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2074
by: Brian Coy | last post by:
I am creating a database to track scrap on a daily basis at my plant. I have to provide a weekly scrap report with the amount of each part scrapped per day. I have the basic database set up, and am trying to generate a report. I have created a report that will show all the data. But I need to show either an empty group for the data on days that there is no scrap or a comment relating as much. My report is set up with a weekly...
2
289
by: Robert | last post by:
I have a report that runs on a parameter query. I run the report, enter the parameter, and it works as long as there is at least one record returned by the query. But if it comes up empty, I get an error in the report. I think there is some way to query the query to see if it's got any records and then exit the report. How is this done? Robert
2
11746
by: bobh | last post by:
Hi All, I have a report which has several sub-reports on it, Each sub-report has its own record source and child/parent link. Sometimes a sub-report may not have data for an entered policy nbr and on the report thier is just an empty space where that sub-report would be when that happens. How do I get the sub-report to still display on the report when it has no data????
3
3715
by: grlgeek | last post by:
I have a report for creating the switchboard labels for our phone system receptionist switchboard. The template has 12 records per column. I setup a report that will create the labels and put a dotted line around them so the receptionist can easily cut them out. The report is setup with columns so that 6 columns fit across a page. 12 records per column, 6 columns across a page, each record has a dotted line around the box. The...
3
1384
by: wgblackmon | last post by:
I'm currently running the following statement that is used in a Crystal Report. Basically, a record is returned when the T_PAYMENT.amount has a record in the database based on the value of the T_MULTILIST.code field. Currently, if there is no record returned, there is no listing in the report for the given T_MULTILIST.code. The user now wants a record to be displayed on the report when there is no record in the database - she wants it...
4
3752
by: wattar | last post by:
Hi all, I will briefly tell you about the structure of my databse, and then will ask you my question. I have a database for project tracking, with a table for projects, and some other tables related to the projects table (i.e. Milestones) I have a report based on a query that selects all the projects that I have and the report is grouped by the project ID. Within this report, I have a subreport for Milestones. the query for the Milestones...
3
12283
ADezii
by: ADezii | last post by:
Null as it relates to database development is one of life's little mysteries and a topic of total confusion for novices who venture out into the database world. A Null Value is not zero (0), a zero (0) length string, an empty Field, or no value at all - so exactly what is Null? The purpose of this Topic is hopefully to explain what a Null Value is, discuss some peculiarities about Nulls, show how we can detect them, and finally, how to convert...
1
2726
by: Stichtek | last post by:
Hi all, I'm new here and new to access and programing and pretty much everything I'm asking for help on. I hope you can help me out. I have an access database. I have a report that lists students and a subreport that points to a different query that lists the subjects that are overdue. I do this by using <Date () in my query for subjects that do not have a result. My report prints fine but I don't want it to list any students who do not...
11
17226
tuxalot
by: tuxalot | last post by:
The easy way is to put cancel = True in the On No Data event of the report. But why replicate code across all reports that way? My app selects reports from a listbox, so I would prefer to check the record count of the query, and if 0, never get to the DoCmd.OpenReport line. Here's the code (case 2 is where I would like to check if the report query has data, and my DCount attempt is not working): ... Dim stDocRS As String 'store...
0
8279
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.