I tryed to use this code I got from keysoulutions to update response documents from their parents, but I’m getting a type MisMatch error. Not sure why, but am confused on the line it’s hanging on. Can someone lend a hand or has anyone used this before?
type MisMatch on note ---- this line:
Call RecursiveSetResponseDocs(note, arr_fieldsToSet)
From http://www.keysolutions.com/servlet/faqsearch
“How do you update a field in response documents after it is changed in the parent document”
Subject: Problem with code: TypeMismatch? HELP!
Hello,
The function RecursiveSetResponseDocs needs to be passed a NotesDocument, which is what the code is assuming you have set “note” to be. You’ll need to declare “note” as a NotesDocument and assuming the document being saved is the parent, set “note” to be the UIDocument.
So if you are putting that code in the QuerySave event…
Dim note As NotesDocument
Set note = Source.Document
Then call the function.
HTH,
Subject: RE: Problem with code: TypeMismatch? HELP!
Set Dim note As NotesDocument
Set note = Source.Document
But getting the same error. Call the Function from QuerySave?
Subject: RE: Problem with code: TypeMismatch? HELP!
What are you passing in as the second parameter?
A way of debugging this kind of issue where functions take multiple parameters is to amend your function to take one value at a time.
Call it using
Call RecursiveSetResponseDocs(note)
Sub RecursiveSetResponseDocs(doc As NotesDocument)
msgbox “Function called OK”
exit sub
REST OF CODE
Then build on it one parameter at a time until you receive an error message.