I have a form that needs to calculate a list of Approvers for a change control db.
This list is calculated by cross-referencing a number of keyword and checkbox fields, the combination of which determines the Approvers.
Each of these keywords has “Refresh fields on keyword change” selected. So I put the code to determine the approvers in the Postrecalc event thinking it would work OK - I was wrong.
Writing the Approver field values using either the back-end doc (doc.ReplaceItemValue…) or the front end (Source.FieldSetText) results in the fields showing blank on the form until I either hit F9 or change an unrelated keyword value.
Can anyone think of a way around this, short of putting a stupid ‘Refresh’ button on the form?
Many thanks…
Suzie
Subject: Try the input Validation event
Put your formula in the input validation, make sure the form is set to auto refresh and as you change keywords and checkboxes, the list should update.
Be advised that some fields require you exit them before the data is ‘real’ and seen by the form. I know this is true of text fields so depending on what you mean by ‘keyword’ field, you may in fact not get to what you want. When I have this problem, I put text on the field ‘click here to refresh the form’. All that happens is the focus leaves the text field and forces an update; no code is needed.
Subject: RE: Try the input Validation event
Thanks, but I’d like to do this entirely in script - are you suggesting I convert part of this to Formula instead?
I’m increasingly thinking a Refresh button is the only way out of this.
(By the way, on the OP I forgot to add that I’d tried saving the UIDoc and the back end doc, no difference. Also, I can’t put a Source.Refresh at the end in there as it goes recursive.)
Subject: Does anyone have any other suggestions please
Subject: RE: Try the input Validation event
It might help if you posted the code so that we can see what you’re doing at the moment.
I have been working on an internal request for change database for the last 18 months (it’s a work in progress), and the approval list for each request is generated by a formula script.