Error in text box when subform returns no values

G

Guest

I am receiving "error" in a number of text boxes that are used to calculate
figures based on 2 subforms. If the subform does not have any records all the
calculated text boxs return this error. I have tried using the nz function
and the ISNull function but i can not seem to get this to work.

=Nz((Claims.Form!sumClaimed),0)-Nz((Payments.Form!sumPaid),0)

Can anyone help me with this problem???
 
G

Guest

Try this

=IIf(Claims.Form.HasData, Nz(Claims.Form![sumClaimed],0),0) -
IIf(Payments.Form.HasData, Nz(Payments.Form![sumPaid],0),0)
 
G

Guest

Thanks for the response to this post, i tried the code below but this still
isnt working for me, i now receive #Name? in the text box. Any other
suggestions that might cause this to happen

Ofer said:
Try this

=IIf(Claims.Form.HasData, Nz(Claims.Form![sumClaimed],0),0) -
IIf(Payments.Form.HasData, Nz(Payments.Form![sumPaid],0),0)

--
I hope that helped
Good luck


Barry said:
I am receiving "error" in a number of text boxes that are used to calculate
figures based on 2 subforms. If the subform does not have any records all the
calculated text boxs return this error. I have tried using the nz function
and the ISNull function but i can not seem to get this to work.

=Nz((Claims.Form!sumClaimed),0)-Nz((Payments.Form!sumPaid),0)

Can anyone help me with this problem???
 
G

Guest

Try this

=IIf(Claims.Form.RecordsetClone.RecordCount>0,Nz(Claims.Form![sumClaimed],0),0)
-
IIf(Payments.Form.RecordsetClone.RecordCount>0,Nz(Payments.Form![sumPaid],0),0)
--
I hope that helped
Good luck


Barry said:
Thanks for the response to this post, i tried the code below but this still
isnt working for me, i now receive #Name? in the text box. Any other
suggestions that might cause this to happen

Ofer said:
Try this

=IIf(Claims.Form.HasData, Nz(Claims.Form![sumClaimed],0),0) -
IIf(Payments.Form.HasData, Nz(Payments.Form![sumPaid],0),0)

--
I hope that helped
Good luck


Barry said:
I am receiving "error" in a number of text boxes that are used to calculate
figures based on 2 subforms. If the subform does not have any records all the
calculated text boxs return this error. I have tried using the nz function
and the ISNull function but i can not seem to get this to work.

=Nz((Claims.Form!sumClaimed),0)-Nz((Payments.Form!sumPaid),0)

Can anyone help me with this problem???
 
G

Guest

Thanks alot ofer the code worked perfectly for me

Ofer said:
Try this

=IIf(Claims.Form.RecordsetClone.RecordCount>0,Nz(Claims.Form![sumClaimed],0),0)
-
IIf(Payments.Form.RecordsetClone.RecordCount>0,Nz(Payments.Form![sumPaid],0),0)
--
I hope that helped
Good luck


Barry said:
Thanks for the response to this post, i tried the code below but this still
isnt working for me, i now receive #Name? in the text box. Any other
suggestions that might cause this to happen

Ofer said:
Try this

=IIf(Claims.Form.HasData, Nz(Claims.Form![sumClaimed],0),0) -
IIf(Payments.Form.HasData, Nz(Payments.Form![sumPaid],0),0)

--
I hope that helped
Good luck


:

I am receiving "error" in a number of text boxes that are used to calculate
figures based on 2 subforms. If the subform does not have any records all the
calculated text boxs return this error. I have tried using the nz function
and the ISNull function but i can not seem to get this to work.

=Nz((Claims.Form!sumClaimed),0)-Nz((Payments.Form!sumPaid),0)

Can anyone help me with this problem???
 
G

Guest

Any time, good luck
--
I hope that helped
Good luck


Barry said:
Thanks alot ofer the code worked perfectly for me

Ofer said:
Try this

=IIf(Claims.Form.RecordsetClone.RecordCount>0,Nz(Claims.Form![sumClaimed],0),0)
-
IIf(Payments.Form.RecordsetClone.RecordCount>0,Nz(Payments.Form![sumPaid],0),0)
--
I hope that helped
Good luck


Barry said:
Thanks for the response to this post, i tried the code below but this still
isnt working for me, i now receive #Name? in the text box. Any other
suggestions that might cause this to happen

:

Try this

=IIf(Claims.Form.HasData, Nz(Claims.Form![sumClaimed],0),0) -
IIf(Payments.Form.HasData, Nz(Payments.Form![sumPaid],0),0)

--
I hope that helped
Good luck


:

I am receiving "error" in a number of text boxes that are used to calculate
figures based on 2 subforms. If the subform does not have any records all the
calculated text boxs return this error. I have tried using the nz function
and the ISNull function but i can not seem to get this to work.

=Nz((Claims.Form!sumClaimed),0)-Nz((Payments.Form!sumPaid),0)

Can anyone help me with this problem???
 

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

Top