0

I just created a subform to have users upload documents. Within the subform, I created a numeric field for users to provide the document's version number. From there, I want a calculated field that would populate to indicate if the document is the most recent or not. I built the below calculation, but it seems like the "MAX" function doesn't actually pull the maximum number from all of the subform entries, so it doesn't really work.

I created a calculated field that is outside of the subform that grabs the MAX version number, but I can't actually reference that field from within the subform.

Below is the calculation:

IF([Version]=MAX([Version]),VALUEOF([Type],"Most Recent"),VALUEOF([Type],"Previous"))
  1. Can anyone assist with the formula?
  2. Is there a better way to automatically have the most recent subform entry be named "Most Recent"?
President James K. Polk
  • 40,516
  • 21
  • 95
  • 125
Max Z
  • 25
  • 2
  • 8

1 Answers1

1

Max to get the max number from a field in the sub-form use the REF() function inside the MAX() function like so,

MAX(REF([Sub-From Field Name],[Version]))

Also, take a look at the MOSTRECENTVALUE() function.

DjP
  • 308
  • 1
  • 6
  • Thank you for this. Having trouble with the REF formula. What would would the "[Sub-From Field Name]" be from as "[Version]" is a field within the subform. – Max Z Mar 11 '19 at 16:44
  • The [Sub-Form Field Name] is the name you gave the sub-form field when you added it to the parent application. If you go to the Formula Builder, locate the sub-form field click the [+] to expand it and select the Version field. It should build the REF() function for you. – DjP Mar 11 '19 at 20:03
  • Hmm. It's not showing. The field I'm trying to calculate is within the subform field, so there's no [+] within the formula builder--only the fields created in the subform. – Max Z Mar 11 '19 at 20:18
  • Unfortunately, what you're looking to do isn't going to work. Sub-forms cannot see all of the records that are created in the application. Only the parent application can see all the sub-form records. If you do the calculation at the parent level it will work, but the sub-form cannot reference the calculation in the parent record. To only way to get it to work is to use an on-demand application instead of a sub-form. – DjP Mar 12 '19 at 18:50
  • Understood. Thank you! – Max Z Mar 12 '19 at 20:18