Open view after created via Lotusscript

Hi, I have some Problems to open a view just after I have created it via Lotusscript. If I close and open the Database again it works but not directly after I’ve created it. Thanks for Help

Code Button 1:

Dim s as New NotesSession

Dim db as NotesDatabase

Set db = s.currentDatabase

call db.CreateView(“test”,“Select @ALL”,False)

Code Button 2:

Dim ws as New NotesUIWorkspace

call ws.setTargetFrame(“Main”)

call ws.currentDatabase.OpenView(“test”)