I have 4 input fields. txtMatCost, txtMatPct, txtMatMarkup and txtMatRate.
I would like these 3 fields, txtMatPct, txtMatMarkup and txtMatRate to be updated if any of the other 2 fields are changed. I don't want to change the value of txtMatCost.
I tried this but get an error on UpdateValues not being valid:
UpdateValues() {
// get current values from collections
Set(cost, First(costCol).cost);
Set(pct, First(pctCol).pct);
Set(markup, First(markupCol).markup);
// calculate other fields
Set(rate, cost * (1 + markup / 100));
// update text fields
Set(txtMatRate.Text, Text(rate, "$0.00"));
Set(txtMatPct.Text, Text(((rate / cost) - 1) * 100, "0.00") & "%");
Set(txtMatMarkup.Text, Text(markup, "$0.00"));
}
Am i trying to go about this the wrong way?
btw, I have not set UpdateValues anywhere else.