Subform Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a form that includes a subform. On my form I have a calculated
value that takes a value on the main form and subtracts the total value on
the subform textbox. The problem occurs when there are no values in the
subform. I get an error. I have been struggling with this for days. I know
I need to test the values in the subform and somehow get a zero in the
calculated text box on the subform, if there is no data--but, I can't get
that to happen. I can get a total count of the records in the underlying
query that populates the subform, but I can't get the filtered value. I am
not sure what event to use--if I need to use one at all.

Any help will be appreciated!!
 
Hi,

Take a look at the Nz function.

If the value in the sub form is null it returns 0.

Access can't calculate a number and a null value.

HTH,

Joe
 
Joe, I don't quite know what is being returned. If there are no records in
the recordset, then the text box is simply blank. I tried the Nz with no
results, so I am assuming a null value isn't being returned, or else I would
get the zero which I so would like to see.

Any other ideas?

Thanks so much for your reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top