Here is my code thus far:
Set view2 = driversDB.GetView(“DriversActiveNewDrivers”) 'populate view2
view2.AutoUpdate = False
Set driversDoc = view2.GetFirstDocument 'get first document in view2
driversname = driversDoc.FirstName( 0 ) + " " + driversDoc.LastName( 0 )
Set pdsearch = settingsDoc.GetFirstItem(“PreviousDrivers”)
'***Problem occurs in loop
Do While pdsearch.Contains(driversname)
Set driversDoc = view2.GetNextDocument(driversDoc)
driversname = driversDoc.FirstName( 0 ) + " " + driversDoc.LastName( 0 )
Loop
Set pdsearch = settingsDoc.GetFirstItem(“PreviousDrivers”)
Call pdsearch.AppendToTextList(driversname)
Call settingsDoc.Save(True, False)
pdsearch is of NotesItem type
settingsDoc is of NotesDocument type
I am getting an “Object Variable Not Set” error message.
My objective is to loop through my drivers database until I find a document that isn’t listed in the “PreviousDrivers” field of my settingsDoc which is found in a separate database.
Any help is appreciated,
Thanks.