Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Problems opening folders that I automatically created via Lotus Script...

Avatar of maximjon
maximjon asked on
Lotus IBM
6 Comments1 Solution1317 ViewsLast Modified:
Hello Everyone,

I need to be able to give users the flexibility to create their own reports in a Lotus Notes database.  Maybe there's an easier way and I might be taking the wrong approach to the design of this database, but I essentially created a form that will manipulate the Notes full text search functions.

Right now the form only has three fields: a text field for the Report Title and two date fields (Start and End).

After the user clicks the 'create report' button, the code I specified below executes.

The program gathers all documents that fall within the date range the user specifies and then dumps them in a folder that is created with the title of whatever the user typed into the 'Report Title' field.

Now the problem I'm having is actually opening up that new folder that was just created.  I put the line: Call ws.CurrentDatabase.OpenView(ReportTitle)   at the end of the code but I get the error message: "View or Navigator '[folder name]' does not exist.  The folder does however exist.  If I close out and come back in I see that it was created by the code.

Is there some other way I should be doing this?  or is my concept of creating a 'reporting form' just poor design all together?

All suggestion appreciated.  Thanks,


Sub Click(Source As Button)
	Dim ws As New NotesUIWorkspace
	Dim s As New NotesSession
	Dim db As NotesDatabase
	Dim vw As NotesView
	Dim doc As NotesDocument
	Dim uidoc As NotesUIDocument
	Dim j As Long
	Dim count As Integer
	
	Set db = s.CurrentDatabase
	Set vw = db.GetView("Main")
	Set uidoc = ws.CurrentDocument
	
	ReportTitle = uidoc.FieldGetText("rptTitle")
 
	Call db.UpdateFTIndex(True)
	
	strSearch = "[dataEndTS] >= " & uidoc.FieldGetText("rptStartDate") & " And [dataEndTS] <= " & uidoc.FieldGetText("rptEndDate")
	j = vw.FTSearch(strSearch, 0)
	
	count = 0
	
	Set doc = vw.GetFirstDocument
	While Not(doc Is Nothing)
		Call doc.PutInFolder(ReportTitle, True )
		Set doc = vw.GetNextDocument(doc)
		count = count + 1
		Print count
	Wend
	Call vw.Clear
	
	Messagebox "Report is complete"
	
	Call ws.CurrentDatabase.OpenView(ReportTitle)
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Bill-Hanson
Bill-HansonFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers