I have a view where the selection formula dynamically changes depending on what the user enters. When I input data and then click the hotspot button to launch the code below, the view’s selection formula gets set correctly, but the view doesn’t refresh. If I look at the view in Designer it does show the right documents though. Also if I restart my client the view then gets refreshed…
Sub Click(Source As Button)
Dim sess As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim db As NotesDatabase
Dim view As NotesView
Set db = sess.CurrentDatabase
Set uidoc = ws.CurrentDocument
Dim uidb As NotesUIDatabase
Set uidb = ws.CurrentDatabase
'check in edit mode
If Not uidoc.EditMode Then
Msgbox "Product line must be in edit mode to search for a new product"
Exit Sub
End If
Search$ = uidoc.FieldGetText("plShortID")
If Len(Search$) < 0 Then
Msgbox "Search value must be more than 3 characters long"
Exit Sub
End If
selection= {SELECT Form = "ProdLoad" & @contains(plShortID; "} & Search$ & {")}
Set view = db.GetView("Shortie")
view.SelectionFormula = selection
Call view.Refresh
Call uidb.OpenView("Shortie", , False)
End Sub