problems with null values on forms

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Access 97

I have a form with 2 sub forms, with 1 text box each. The
text boxes in the sub forms are based on to different sub
queries that sum 2 different queries

Then I have a text box, on the main form, that sums the
values in those 2 sub forms to come up with a total.


The problem I'm running into is that if there is no
records to sum in the query (not the sub query) the value
returned when your run the sub quarry has no records

And when I try to add the to sub forms text boxes with the
text box on the main form when one of the sub queries has
the above mentioned problem I get an error

I tried to use the NZ() to over come that but it dose not
work


note:
I'm new to access so i may be overlooking some very simple
things
 
Steve;

There may be a better way but until I learn it I have been using this:

Total:
iif(isnull([FirstNumber]),0,[FirstNumber])+iif(isnull([SecondNumber]),0,[Sec
ondNumber])

What it means is "if the "Control" is blank create a zero" if the control
contains a number use it..

You will have to change "FirstNumber" and "SecondNumber" to the name of your
controls.

Andy
 
You can set the default value for the text box in the subform to 0, then you
won't get a null value.

Kelvin
 
Back
Top