if a # then sum, if text leave null

F

fishqqq

I'm having trouble with my expression for a field i'm trying to
populate.

The field is in a subform and is called:
Forms![AWB Main Info]![fMAWBPcsWgt].Form![text30]

I need this field to capture the SUM of :
Forms![AWB Main Info]![fMAWBPcsWgt].Form![Total]

but it is only to capture the sum of [Total] if there is a numeric
value in [Total]
If there is a text value in [Total] i need [text30] to be null

in the controll source of [text30] i have entered the following to try
to accomplish this:

IIF(IsNumeric([Total]),Sum(Val([Total]),2), Null)

This is giving me an error message saying the expression is too
complex

can anyone suggest how to correclty do this?

thanks
Steve
 
F

fishqqq

Try this:

=SUM(IIF(IsNumeric([Total]), Val([Total]), 0))

--

        Ken Snellhttp://www.accessmvp.com/KDSnell/










I'm having trouble with my expression for a field i'm trying to
populate.
The field is in a subform and is called:
Forms![AWB Main Info]![fMAWBPcsWgt].Form![text30]
I need this field to capture the SUM of :
Forms![AWB Main Info]![fMAWBPcsWgt].Form![Total]
but it is only to capture the sum of [Total] if there is a numeric
value in [Total]
If there is a text value in [Total] i need [text30] to be null
in the controll source of [text30] i have entered the following to try
to accomplish this:
IIF(IsNumeric([Total]),Sum(Val([Total]),2), Null)
This is giving me an error message saying the expression is too
complex
can anyone suggest how to correclty do this?
thanks
Steve

works great, thanks Ken
Steve
 

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