I’m just getting back into serious Notes programming after a serious illness which caused brain damage. It’s interesting how spotty my “forgotten” is, but there are still things I’m re-learning after 5 years!
Here’s my problem:
I am trying to pass a multi-value Listbox field to a Sub, which in turn passes it on to another. This field contains an array of 1 to x form names which I need field names from. An array in the array is populated.
Here’s my code snippets:
Public Sub reSelectForms( d As NotesDocument )
’ this resets targetDbFieldNameCounter so that we can import the fields…
targetDbFieldNameCounter = 0
’ *********************************
’ The next line is where it bombs out with a Type Mismatch
Call getFieldNames( d.GetItem(“TargetDbForms” ).values )
doc.fieldNames = targetDbFieldNames
End Sub
…
’ I’ve tried an array as it is now, and List. Neither worked… :-<
Public Sub getFieldNames( formNames() As String )
Dim tForm As NotesForm
Forall forms In formNames
Set tForm = targetDb.GetForm( forms )
Forall field In tForm.Fields ’ now get the fields one at a time…
Redim Preserve targetDbFieldNames( targetDbFieldNameCounter ) ’ expand the size of the array
targetDbFieldNames( targetDbFieldNameCounter ) = field
targetDbFieldNameCounter = targetDbFieldNameCounter +1
End Forall
End Forall
End Sub
I guess what I’m trying to say is that I can’t use d.GetItem(“TargetDbForms” )(0), but that doesn’t even work!
Help! What am I missing?
Marcus