Computed subform formulas are only evaluated when a form is first opened. Try setting the formula field value, then closing and reopening the document with LotusScript (it may be quick enough to not be noticed). Otherwise, you could try including several sections (or several subforms) on the form with hide formulas that refresh dynamically and determine which information is displayed.
I have used a different method to accomplish this same task.
Put a @PickList statement in a computed-when-composed field to allow the selection of the keyword.
@PickList( [Custom] : [Single] ; @DbName ; "Subforms" ; "Choose the Category for this document" ; "Please make your selection from the following Categories:" ; 1 )
In this example, "Subforms" is the name of a hidden view in the database that contains a list of the desired categories. The subforms are named to correspond to the categories.
Make sure this field appears above the computed subform. The value of the computed subform is then set to the name of the field containing the @PickList formula.
When the document is composed, it brings up the @PickList dialog before displaying the form. The user chooses the category, and then Lotus Notes continues processing the form. When it gets to the computed subform, it evaluates to the category (subform name) that the user picked.
Do you have comments on this Ask the Expert Q&A? Let us know.
Dig Deeper on LotusScript
Related Q&A from Brad Balassaitis
Upon moving to Lotus Notes 8, some Lotus Notes users received an error message stating: 'Database has not been opened yet.' Find out why here. Continue Reading
Discover what security settings you need to fix if you encounter the Lotus Notes database error: 'database is not opened yet.' Continue Reading
Learn the Formula language code that you can use if you'd like your Lotus Notes form with embedded views to stop displaying all response documents. Continue Reading