I have an Expense Form created in LiveCycle, where a user clicks an icon button for an individual expense category (i.e. Meals, which is under form1.ExpenseReport.ExpenseType.TravelMeals) and a repeating subform (with a min instance count set to 0) is displayed for each separate category. At the end of the report is a Summary page that contains subforms (i.e. form1.Summary.MealsSumm) calculating the totals for all of the repeating subforms from each individual category (in FormCalc), and then the total of all categories are summed in the beginning of the Acknowledgment section (which is originally hidden from the form’s layout) under form1.Footer.
There are remove buttons in the subforms (i.e. form1.ExpenseReport.Expenses.Meals.MealsExpense.RemoveExpense) and the totals update when the subforms are removed. However, if all of the subforms for one category are removed (i.e. all Meals’ expenses), and a user goes back to add another Meals expense, the form doesn’t recalculate, and the totals in the Summary and Acknowledgment sections stay at $0. However, if the user were then to click the Remove button in the Summary section for Meals (after they click the Remove button in the upper Meals expense), and then goes back and adds another expense, the totals update correctly. Unfortunately, our end-users would not know to go down to the Summary section to remove that Meals line item from the Expense as that is for internal use only.
Therefore, I had tried putting this in FormCalc on the Mouse Down event of the Remove button (this example is on the Airfare expense):
if (I == 0) then
form1.Summary.AirSumm[*].AirTotal.rawValue == "0"
And this in the Mouse Up event of the Remove button (in FormCalc):
if (I <= 1) then