View.selection formula and view rebuild question

I’m using the new view.SelectionFormula command to change a view. I then compose a new doc with field formulas related to that view. The form does not get saved - it’s just a means to display calculated values.

The problem I am having is that my form formulas do not recalculate based on the new view selection formula unless I open the view first. (which I don’t want to do) I’m using refresh but it still doesn’t update the view for the form formulas. Is there something else I can do without opening the view first?

I actually tried to open the view and then close it, but then I got the “command not available from the workspace” error, and couldn’t get around that. I’d really just rather have the view updated thru LS.

The view is set to refresh=Automatic, and here’s the code that’s giving me trouble:

view.SelectionFormula = newformula

Call view.Refresh

Call uiws.SetTargetFrame(“View Frame”)

Call uiws.ComposeDocument(“”,“”,“My Form”)

Call uiws.viewrefresh

I am also using view.selectionformula to update other views, but since I open these views in the frameset, they always display correctly. This one gives me trouble because I don’t actually open the view, I just want to use its contents for this form.

Any ideas, please?

Subject: SOLUTION found while waiting for help

just by chance, I stumbled across the problem. So, for anyone else, here’s my working code…

view.SelectionFormula = newformula

Call view.Refresh

'open the selected view to rebuild it

Dim uiview As notesuiview

Call uiws.SetTargetFrame(“View Frame”)

Call uidb.OpenView(viewname)

Set uiview = uiws.CurrentView

Call uiview.close

Call uiws.SetTargetFrame(“”)

Set uidoc = uiws.ComposeDocument(“”,“”,“My Form”)

uidoc.editmode = True

Call uiws.viewrefresh

Subject: RE: SOLUTION found while waiting for help

When this code has ran on my notes 6 client :

Dim uiws as new notesUIWorkspace

Dim uidb as notesUIDatabase

set uidb = uiws.CurrentDatabase

Call uiws.SetTargetFrame(“View Frame”)

Call uidb.OpenView(viewname)

Every time I quit the notes client and this code has runned, I get a red screen, any idea, issues ?