Hi to everyone.
We had a requirment for making a search screen, on clicking the generate report Action on the form, A dynamic view is created with the selection criterion embedded in the Selection Formula of the view.
– We take values from the Form
– Create a Selection Criterion - String querystring
– Generate a new view using CreateView - NotesView
– Then Open the view using OpenView
Now we are Ok till the 3rd point. The view is generated. But when we do the OpenView command, It gives an Error Message Saying that the View does not exist. Here is the code.
newviewname = Trim(“delete” + Cstr(Round((8999 * Rnd + 1000),-2)) + Cstr(Hour(Now))+Cstr(Minute(Now))+Cstr(Second(Now)))
'Formula that will apply in the New created View
myviewformula = |SELECT Form = “Project_information” | & querystring
'Create new view with name from user input
Set UsersView = s.CurrentDatabase.CreateView(newviewname,myviewformula,view)
----Then to open the view we do this.----
Set ws = New NotesUIWorkspace
Call ws.ViewRefresh
Set udb = ws.GetCurrentDatabase
Call udb.OpenView(newviewname, , False,True)
The Problem is that sometime this code works and some time it doesnt work. It gives an error saying that the view not found. Please Help in this situation.
Regards,
Jawad Rana.