swaybright
Technical User
I am totally clueless on how get data from a lotus notes db. I have spent days on this and am extremely frustrated.
What I want to do:
1: open a lotusnotes database
2: go to desired view(note the views are in folders)
3: search view with a search string
4: return hit set
5: see if hit set has records or has more than one record if has one record go to 6 if has no records go to 8 if has more than one record goto to error
6: open document in hit set
7: return specified field value in document (right now I'm just doing this in a message box, but later I want to put these value(s) in existing access table(s)
8: change view to a second view (there are two possible places that the document can be within the database)
9: verify single hit if not go to error
10: do step 7
I can't get past searching for a document and returning a value. Here is the code I am using. I know it is all fouled up, but like I said, I have no idea what I am doing. I am trying to piece together code I have found on this site and others with little understanding, so I can't troubleshoot it. I am getting a type mismatch error on the line indicated below. and the debugger is not returning the value for testvar that I expected; it is returning an empty string (""
. Please help!!!
Dim session As Object 'notes session
Dim db As Object 'notes database
Dim view As Object 'notes view
Dim searchview As Object 'notes search results
Dim doc As Object 'notes document
Dim DocCount As Long
Dim ViewStr As String
Dim testvar As string
ViewStr = "3. R&D\By Period"
Set session = CreateObject("Notes.NotesSession"
Set db = session.GETDATABASE("SERVERNAME", "user\chemical\millad.nsf"
Set view = db.GetView(ViewStr)
Set doc = view.getfirstdocument
testvar = doc.getitemvalue("tll"
'Here is where I get the error
MsgBox "The value in t11 is " & testvar _
& ".", vbOKOnly, "LotusNotes Value"
What I want to do:
1: open a lotusnotes database
2: go to desired view(note the views are in folders)
3: search view with a search string
4: return hit set
5: see if hit set has records or has more than one record if has one record go to 6 if has no records go to 8 if has more than one record goto to error
6: open document in hit set
7: return specified field value in document (right now I'm just doing this in a message box, but later I want to put these value(s) in existing access table(s)
8: change view to a second view (there are two possible places that the document can be within the database)
9: verify single hit if not go to error
10: do step 7
I can't get past searching for a document and returning a value. Here is the code I am using. I know it is all fouled up, but like I said, I have no idea what I am doing. I am trying to piece together code I have found on this site and others with little understanding, so I can't troubleshoot it. I am getting a type mismatch error on the line indicated below. and the debugger is not returning the value for testvar that I expected; it is returning an empty string (""
Dim session As Object 'notes session
Dim db As Object 'notes database
Dim view As Object 'notes view
Dim searchview As Object 'notes search results
Dim doc As Object 'notes document
Dim DocCount As Long
Dim ViewStr As String
Dim testvar As string
ViewStr = "3. R&D\By Period"
Set session = CreateObject("Notes.NotesSession"
Set db = session.GETDATABASE("SERVERNAME", "user\chemical\millad.nsf"
Set view = db.GetView(ViewStr)
Set doc = view.getfirstdocument
testvar = doc.getitemvalue("tll"
MsgBox "The value in t11 is " & testvar _
& ".", vbOKOnly, "LotusNotes Value"