473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

checking for NULL in a control source

Hi everyone,

I have a report that has a text box and the text box simply shows the
sum of the amount field in the report.

So, the control source is simple = SUM(Amount).

The problem is that sometimes the query can return no records. In that
case, my report just shows #ERROR for this field. What I would like to
do is check if the SUM(AMOUNT) value is NULL and if it is NULL, I would
like to just show 0.

With VBA, of course, it is straight forward. However, I have no idea
how to use it with the reporting stuff.

Appreciate any help you can give me.

Thanks,

Pankaj

Dec 8 '06 #1
1 3212
On 7 Dec 2006 16:31:59 -0800, "de**********@gmail.com"
<de**********@gmail.comwrote:

If there is no data, then obviously there is no sum either.
An elegant solution is to write this in the Report_NoData event:
Msgbox "There is no data for your criteria",vbInformation
Cancel = True 'Close the report

-Tom.
>Hi everyone,

I have a report that has a text box and the text box simply shows the
sum of the amount field in the report.

So, the control source is simple = SUM(Amount).

The problem is that sometimes the query can return no records. In that
case, my report just shows #ERROR for this field. What I would like to
do is check if the SUM(AMOUNT) value is NULL and if it is NULL, I would
like to just show 0.

With VBA, of course, it is straight forward. However, I have no idea
how to use it with the reporting stuff.

Appreciate any help you can give me.

Thanks,

Pankaj
Dec 8 '06 #2

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

Similar topics

3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
30
by: Michael B Allen | last post by:
I have a general purpose library that has a lot of checks for bad input parameters like: void * linkedlist_get(struct linkedlist *l, unsigned int idx) { if (l == NULL) { errno = EINVAL;...
10
by: Mikhail Teterin | last post by:
Hello! Consider the following simple accessor function: šššššššštypedefšstructš{ ššššššššššššššššintššššši; ššššššššššššššššcharššššname; šššššššš}šMY_TYPE; ššššššššconstšcharš*
9
by: D. Shane Fowlkes | last post by:
(ASP.NET 2 / VB) Question - How can I write a If statement to see if a control (textbox) actually exists on a page? Upon page_load, a certain control may or may not be visible on the page so I...
2
by: Jim McGivney | last post by:
In asp 2.0 I am trying to insert a row using a detailsview control connected to an accessDataSource. I get the error message below. I am having trouble identifing which data field is causing the...
2
by: Simon Rigby | last post by:
Hi folks, A bizarre problem I am having. I have a treeview which is bound to an XmlDataSource. The XMLDataSource.Data property is set to the result of a function that generates an XML...
9
by: Zeba | last post by:
Hi , I'm having problems using Visual Source Safe with my Visual Studio 2005. I have correctly connected to the VSS database with userid and set up a project in VSS comprising mySite. I set the...
8
by: aarklon | last post by:
Hi all, see:- http://linuxgazette.net/issue51/pramode.html
2
by: cmrchs | last post by:
Hello, I have a GridView and an objectDataSource <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AllowPaging="True" /> <asp:ObjectDataSource...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.