Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum



PreviousPrevious NextNext

Loyd Chis 27.Oct.06 03:36 PM a Web browser
Domino Designer 6.5.5 Windows XP

I have this code that lets the user pick a year and a location then displays the info. The code just pulled in the data from one view and displayed the embedded view with the data.

I need to change this up a little but not sure how. Instead of showing the embedded view, I have rich text fields that I need to populate, basically making a list on the new form, but one document.

Sub Click(Source As Button)
'dim and set the objects
Dim session As New notessession
Dim dbCurr As notesdatabase
Set dbCurr = session.currentdatabase
Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim docCurr As NotesDocument
Dim pickDoc As notesdocument
Set uidoc = ws.currentdocument
Dim newuidoc As notesuidocument
Set docCurr = uidoc.document
Dim getdoctitle As Variant, doctitle As String
Dim yearnums(3) As Variant
Dim yearvals(3)
Dim i As Integer
Dim pickview As notesview
Set pickview = dbCurr.getview("ShowLocation")
'what year do they want, present list of one year before current year, current year, and one year after
'or alternatively give them a picklist of year view
YearNow = Year(Today)
yearnums(0) = YearNow + (-1)
yearnums(1) = YearNow
yearnums(2) = YearNow + 1

For i = 0 To 2
yearvals(i) = Cstr(yearnums(i)) 'convert the years to a string so that we can present it

'give them the view to choose a document from
server = dbCurr.server
dbname = dbCurr.FileName
viewname = "showlocation"
'give them a list of documents for selection
picklist = ws.Pickliststrings(3,1,server,dbname,viewname, "OSHA Form 300","Select a Location.",3,"")
If Isempty(picklist) Then Exit Sub 'they have pressed cancel
location = picklist(0)

whichyear = ws.Prompt( PROMPT_OKCANCELLIST, "OSHA Form 300", "What year do you want to view?", yearvals(1), yearvals)
If whichyear = "" Then
'they have pressed cancel
Exit Sub
End If

temp1 = Strleft(location, "^")
temp2 = Strright(location, "^")

'create the document and open it
Dim OSHA300form As NotesDocument
Set OSHA300form = dbCurr.CreateDocument
OSHA300form.Form = "OSHA300form"
OSHA300form.selection = temp1 & "~" & whichyear
OSHA300form.formloc = temp1
OSHA300form.formyr = whichyear
OSHA300form.formstate = temp2

Set NewUIDoc = ws.EditDocument(True, OSHA300form, False)

End Sub

I do still need to capture the year and location then display the data based on those fields. Below are fields ( a,b,c,d,e,f) that I have on the form where the data will be displayed. I'm just not sure if I'm collecting them correctly. It should loop through the docs and display the fields on the new document.

I'm just really confused will all the ways to colllect the data. The more I look at this, the more I get confused????

Can someone kinda narrow this code down so it makes sense to me. Thanks.

If collection.Count > 0 Then

Set doc2 = db.CreateDocument
doc2.form = "OSHA300Form"
doc2.formloc = location

Set doc = collection.GetFirstDocument

Do Until doc Is Nothing

doc.a = CaseLog
doc.b = EmpFullName
doc.c = EmpJobTitle
doc.d = CaseDate
doc.e = CaseWhereOccurred
doc.f = CaseInjuryorIllnes


Set doc = collection.GetNextDocument(doc)

'Call True, True )
Set uidoc = ws.EditDocument(False, doc2)

End If
End Sub

  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite