I have an object variable not set error and can’t seem to locate the error in my code. can anyone else see my error? thanks
Sub Onchange(Source As Field)
Dim workspace As New NotesUIWorkspace
Dim ContextView As NotesView
Dim contextDoc As NotesDocument
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim context, contextStringDesc As String
Dim contextDesc As Variant
Dim db As NotesDatabase
Set uidoc = workspace.CurrentDocument
Set db = session.CurrentDatabase
Call uidoc.Refresh
'get the currently entered contextTag and display in form banner
context = uidoc.FieldGetText("m_dlgContextTag")
Call uidoc.FieldSetText("m_txtCompContext", context)
'select the decription for the currently entered context tag
Set contextView = db.GetView("m_viwContextTag")
Set contextDoc = contextView.GetDocumentByKey(context)
contextDesc = contextDoc.GetItemValue("ContextDescription")
contextStringDesc = contextDesc(0)
'set the current context description
Call uidoc.FieldSetText ("m_txtCompDesc", contextStringDesc)
'Refresh the document
Call uidoc.Refresh
End Sub