Show a Field in a Subform Based on Selected Item

Show a Field in a Subform Based on Selected Item

Hello everyone,

I'm trying to dynamically show a field inside a subform based on the selected item, but I’m running into issues.

My Setup:

I have three forms:

  1. "List of Documents" → Stores the master list of documents with:

    • Document Name (Single Line)
    • Status (Dropdown: Active/Inactive)
    • Expiration Date (Dropdown: With Expiration / Without Expiration)
  2. "Documents" → Stores employee-specific document records with:

    • Employee (Lookup)
    • Document (Lookup to List of Documents)
    • PDF File (File Upload)
    • Expiration Date (Date Field, manually entered if applicable)
  3. "Employes" → This is my main form, where I added a subform linked to the "Documents" form.

What I Need to Achieve:

  1. In the Employes form, when i want to add a document in the subform, the Document dropdown should only show Active documents (from "List of Documents").
  2. If the selected document (from "List of Documents") has "With Expiration", then the Expiration Date field should appear inside the subform.
  3. If the selected document is "Without Expiration", then the Expiration Date field should remain hidden inside the subform.

My Questions:

  1. How can I filter the Document dropdown in the subform to only show Active documents?
  2. How can I dynamically show/hide the Expiration Date field in the subform based on the document’s expiration type?