source.ClearField & subform

I have a main form with two subforms. The hide/whens for the subforms are dependant on the Reason code selected on the main form.

Example:

Reason Code 1 displays subform grid 1

Reason Code 2 displays subform grid 2

If the user selects code 1 and fills out grid 1 and then changes their reason to code2 and fills out grid2, when the document is submitted for approval, I want to clear the fields of the unused grid.

I’m using this code amidst the save & submit action button:

Call uidoc.FieldClear(“field name”)

It finds the fields and appears to execute, but is not clearing the values. This is probably something easy and I’ll be embarrassed I couldn’t find it myself, but didn’t see anything in the forum regarding this.

Any guidance would be appreciated.

Subject: source.ClearField & subform

Barbara,

grab the backend document and clear the fields using the extended syntax. Once your user goes to the second computer subform, I would assume any ability to reference subform1 would be null and void. the fields would still exist on the backend doc, however and you could clear those before saving.

hth.

brandt