Trying to translat Excel calculated field syntax to Access syntax

I'm trying to translate this from an Excel worksheet:


to an Access form field calculation.

Note that in the Access form these are the cooresponding field names:

C11 = txtGrossCWT
E11 = txtFM
M7 = Header txtFMMax
M8 = Header txtDisSchd2

I don't even know where to begin.  Any help would sure be appreciated.
Who is Participating?
Gustav BrockConnect With a Mentor CIOCommented:
Replace IF with the function IIf and the cell references with your control names.
NorieVBA ExpertCommented:
Are all these values in the same record?
SteveL13Author Commented:
The top 2 are in the same record.  The bottom 2 have to come from the Main Form.  The datasheet form is a sub-form in the main form.
Dale FyeConnect With a Mentor Commented:
are you attempting to do this as the value in a control source, or doing it in a query?

So you have a couple of issues,
1.  you must replace the Excel IF( ) statement with the Access IIF( )
2.  I have assumed that the values for cells M7 and M8 are actually controls in your form, so I have referred to them as me.txtFMMax and me.txtDisSchd2


Personally, I'd create a function for that so that you can document why you are performing the calculations the way you are.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.