I am trying to write a VBA module for use inside an MS Access database. Inside the Access dB, I have a claim number. I need to set up a button on my form in Access which, when clicked opens the Claims Database, which is a Lotus Notes Database. I do not need to transfer any data in either direction, I just want to open the Notes database in the client of Lotus Notes, and show the form view for the record (document in Notes terminology) that matches my claim number. I do not know Notes at all. I have managed to enable the Notes objects/classes in Visual Basic, but don't know how to correctly use them. I have the server path, database file name, name of the form inside the Notes dB, and the name of the field on the Notes form (which I need to match to my variable)...
So far, I can only successfully open the Notes database using a shell command. I have a test code module where I have been able to successfully (I think) declare the needed variables, set session, set db, but db.open gives me a "type mismatch" error. Below is the code so far (which isn't working... and I have not added the details to specify the field and search variable yet):
Private Sub test2()
Dim db As Object
Dim dbname As String
Dim dbpath As String
Dim session As Object
Dim view As Object
Set session = CreateObject("Notes.NotesSession")
dbname = "<mydatabase.nsf>"
dbpath = "<myserverpath/>"
Set db = session.GetDatabase(dbpath, dbname)
Set view = db.GetView("<myformname>")
db.Open
End Sub
So far, I can only successfully open the Notes database using a shell command. I have a test code module where I have been able to successfully (I think) declare the needed variables, set session, set db, but db.open gives me a "type mismatch" error. Below is the code so far (which isn't working... and I have not added the details to specify the field and search variable yet):
Private Sub test2()
Dim db As Object
Dim dbname As String
Dim dbpath As String
Dim session As Object
Dim view As Object
Set session = CreateObject("Notes.NotesSession")
dbname = "<mydatabase.nsf>"
dbpath = "<myserverpath/>"
Set db = session.GetDatabase(dbpath, dbname)
Set view = db.GetView("<myformname>")
db.Open
End Sub