[AccessD] What to do when subreport used as textbox source has no data

Charlotte Foust cfoust at infostatsystems.com
Wed Oct 8 19:15:52 CDT 2003


Do you possibly mean an Nz function?  If so, it was also available in
Access 97, as is IsNull.  I've never seen an NV function in Access.  

Charlotte Foust

-----Original Message-----
From: Ron Allen [mailto:chizotz at charter.net] 
Sent: Wednesday, October 08, 2003 3:39 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] What to do when subreport used as textbox source
has no data


Hi Nancy,

The problem, I believe, is that when there is a null value 
the whole expression evaluates to null. I have solved this 
a few ways, but the easiest in most cases is something 
like this: txtAB = iif(Sub1.field,Sub1.field,0) + 
iif(sub2.field,sub2.field,0)- iif(sub3.field, 
sub3.field,0). I work mainly in Acc97, but in Acc2k and 
above there is also a NV function you could look at. This 
isn't perfect for all cases, but it does work for me.

HTH,

Ron



On Wed, 8 Oct 2003 19:00:43 -0400
  "Nancy Lytle" <LYTLEN at peoplepc.com> wrote:
>I have a main report with 3 subreports, all are related
>by the field
>ProgramCode.  There is a record in three of the reports 
>(Main and 2
>subreports) for every ProgramCode.  I also use the values 
>in the subreports
>to populate a text box - txtAB = Sub1.field + sub2.field- 
>sub3.field -
>sub3.field.  This works fine except for the case where 
>the ProgramCode has
>no record in Subreport3, then that subreport doesn't show 
>and the textbox is
>filled with error#.  How do I get the textbox to use 
>txtAB = Sub1.field +
>sub2.field where there is no sub report for the linked 
>field.
>
>Hope I explained this okay.
>TIA
>Nancy L
>
>N_Lytle at terpalum.umd.edu
>240-274-0069
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system
>(http://www.grisoft.com).
>Version: 6.0.524 / Virus Database: 321 - Release Date: 
>10/6/2003

<TEXTAREA NAME="Signature" ROWS="4" COLS="60">
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list