Formula code help

I’m creating a web based database that deals with workflow. I have 16 sections that all have the same fields according to what office it represents. These sections hide when their office is not assigned to review the submitted report.

I have a ‘global resolution’ field that shows whether the status of the report is pending review or closed. I want it to show closed when a specific field in each section has a value in it showing that the corresponding office has reviewed and submitted their own section.

My first attempt was this:

@If(Status = “New”: “Submitted”; “”; PIT_AG1Closed != “” & PIT_AG2Closed != “” & PIT_AG3Closed != “” & PIT_AG4Closed != “” & PIT_AG5Closed != “” & PIT_AG6Closed != “” & PIT_AG15PIClosed != “” & PIT_AG15CorpClosed != “” & FAM_FranClosed != “” & FAM_IncClosed != “” & FAM_SalesClosed != “” & PATB_DownClosed != “” & PATB_UpClosed != “” & TTTBClosed != “” & RCBClosed != “” & CCEDClosed != “” & OPTSClosed != “”; “Closed”; “Pending”)

However, some of these fields will be hidden if the office has not been assigned to review the report. So the above code doesn’t work. How do I take into account that some of these fields will be hidden? What code do I add?

Subject: Formula code help

Dumb question - if you have 16 sections that are all identical, why do you have 16 sections?

If every office has to fill in the same data, just use one set of fields for everyone.

If the issue is the form’s static text (ie for office 1, field ABC, you want the text next to the field to say ‘West Coast’ but for office 2 you want ‘South Central’), then make the static text Computed for Display fields that compute the right text for each region.

That way, you’re dealing with one set of fields, one workflow, and WAAAAY easier code to maintain.

Just a thought.

Doug

Subject: Formula code help

Even if fields are hidden (by hide-when) or in subforms that aren’t being used, data fields are still available in the document - unless they are are computed for display. If a field hasn’t been created yet, in the above formula it will behave as it has the value “”.