have written this function:
Function getRegionDocumentID(rname As String)As String
Dim s As New NotesSession
Dim thisdb As NotesDatabase
Dim Internaldb As NotesDatabase
Dim ndc As NotesDocumentCollection
Set thisdb = s.CurrentDatabase
Set Internaldb = s.GetDatabase(thisdb.Server, "Internal.nsf", False)
searchformula$ = {RegionName="}+country+{"}
Set ndc = internaldb.Search(searchformula$, Nothing, 0)
If ndc.Count<>1 Then
Messagebox ( "An Error has occurred" )
Goto jump
End If
getRegionDocumentID=ndc.GetFirstDocument.UNID
jump:
End Function
Now, as I understand it, this means that I should now be able to call this method with a simple String = getRegionDocumentID(String) and retrieve the value of the function. Hence this button:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim regiondocid As String
Set uidoc = ws.CurrentDocument
Forall x In uidoc.Document.Regions
regiondocid = getRegionDocumentID(x)
Call uidoc.FieldAppendText("RegionUNIDs", regiondocid + "; ")
End Forall
End Sub
But it won't compile, it tells me that there's an illegal parenthesized reference, and points t the line with my function call on it! Any help appreciated!
Chris
Function getRegionDocumentID(rname As String)As String
Dim s As New NotesSession
Dim thisdb As NotesDatabase
Dim Internaldb As NotesDatabase
Dim ndc As NotesDocumentCollection
Set thisdb = s.CurrentDatabase
Set Internaldb = s.GetDatabase(thisdb.Server, "Internal.nsf", False)
searchformula$ = {RegionName="}+country+{"}
Set ndc = internaldb.Search(searchformula$, Nothing, 0)
If ndc.Count<>1 Then
Messagebox ( "An Error has occurred" )
Goto jump
End If
getRegionDocumentID=ndc.GetFirstDocument.UNID
jump:
End Function
Now, as I understand it, this means that I should now be able to call this method with a simple String = getRegionDocumentID(String) and retrieve the value of the function. Hence this button:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim regiondocid As String
Set uidoc = ws.CurrentDocument
Forall x In uidoc.Document.Regions
regiondocid = getRegionDocumentID(x)
Call uidoc.FieldAppendText("RegionUNIDs", regiondocid + "; ")
End Forall
End Sub
But it won't compile, it tells me that there's an illegal parenthesized reference, and points t the line with my function call on it! Any help appreciated!
Chris