I’ve got the following code that is behind an action button on a call logging form, the button Reassigns the call to another person. It brings up the dialog box to select a name but then comes back with the error ‘Variant does not contain an object’
Any ideas would be gratefully recieved
Thanks
Claire
Sub Click(Source As Button)
'Declare the objects
Dim session As New notessession
Dim workspace As New notesuiworkspace
Dim db As notesdatabase
Dim uidoc As notesuidocument
Dim doc As notesdocument
Dim checkdoc As notesdocument
'Declare the main objects
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
'Create a new dummy document for the results of the dialog box
Set checkdoc = New notesdocument(db)
'Display the dialog box
keypress = workspace.dialogbox(“dlgChecker”, True, True, False, False, False, False, “Select Checker”, checkdoc)
'Make sure OK was pressed
If (keypress = True) Then
'Make sure a name was entered on the dialog box
If (checkdoc.CCT_Checker(0) <> “”) Then
'Prepare an e-mail to send to the Checker
Set maildoc = New notesdocument(db)
'Set the values on the mail
maildoc.Form = “mailReassignChecker”
maildoc.From = session.UserName
maildoc.DateSent = Now
maildoc.SendTo = checkdoc.CCT_Checker(0)
maildoc.Subject = "Relationship Check Request reassigned to you: " + doc.Client_Name(0)
maildoc.nPreviousChecker = doc.CCT_Checker(0)
maildoc.dLastAssigned = doc.AssignDate(0)
maildoc.tClientName = doc.Client_Name
maildoc.nRequested = session.UserName
maildoc.dRequested = Now
'Set the DocLink on the mail
Set rtitem = New notesrichtextitem(maildoc, “rtLink”)
Call rtitem.AppendDocLink(doc, “Click to access Relationship Check Request”)
'Send the document
maildoc.Send True
'Now reset the status on the document
doc.Status = “A”
doc.AssignDate = Today
doc.CCT_Checker = checkdoc.CCT_Checker(0)
'Update the history to show the request has been assigned
checkername = Evaluate(“@Name([CN]; CCT_Checker)”, doc)
Call UpdateHistory(doc, "Reassigned to " + checkername(0))
End If
'Save the changes
Call doc.save(True, True)
'Now close the document and refresh the view
Call uidoc.Close
Call workspace.ViewRefresh
End If
End Sub