# Convert Excel formula that includes IfError to Access

I have an Excel formula that looks like:

=IFERROR((MAX((((G11-\$M\$5)*F11)*\$M\$6),0)),"")

The corresponding Access form fields are:

G11 = txtMST
M5 = txtMoistureMax
F11 = txtCleanCWT
M6 = txtDisSchd1

How do I convert this to Access?
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Senior developer, analyst and customer assistance Commented:
Something like
IIF ((((txtMST-txtMoistureMx)*txtCleanCWT)*txtDisSchd1) <= 0,0,"")
CIOCommented:
I guess it catches an error condition where a cell could be empty. If so, for the calculation:

``````= IIf((txtMST - txtMoistureMax) * txtCleanCWT * txtDisSchd1 >= 0, (txtMST - txtMoistureMax) * txtCleanCWT * txtDisSchd1, 0)
``````
or to catch the error to return 0 instead of Null:

``````= IIf((Nz(txtMST, 0) - Nz(txtMoistureMax, 0)) * Nz(txtCleanCWT, 0) * Nz(txtDisSchd1, 0) >= 0, (Nz(txtMST, 0) - Nz(txtMoistureMax, 0)) * Nz(txtCleanCWT, 0) * Nz(txtDisSchd1, 0), 0)
``````

Experts Exchange Solution brought to you by