How do you select multiple values in a Checkbox.
I need help with the code below.
When I exit the current field, I want to the “ALL” value in the checkboxValues field to be selected.
Sub Exiting(Source As Field)
Dim ws As New NotesUiWorkspace
Dim uiDoc As NotesUiDocument
Dim doc As NotesDocument
Dim checkboxTx As String
Dim values As Variant
Set uiDoc = ws.CurrentDocument
Set doc = uiDoc.Document
checkboxTx=uidoc.FieldGetText( “checkboxValues” )
values =Evaluate( |@trim(“ALL”:checkboxTx)|)
doc.checkboxValues= values
Call uiDoc.Reload
End Sub
Subject: How do you select multiple values in a Checkbox.
The evaluate statements needs some help here.
values = Evaluate( |“ALL”:@Explode(“| + checkboxTx + |”;“;”)|)
This assumes that the text was separated with semicolons. Adjust accordingly if you used a comma separator.
Collin
Subject: RE: How do you select multiple values in a Checkbox.
Thanks
Subject: How do you select multiple values in a Checkbox.
Dim ws As New NotesUiWorkspaceDim uiDoc As NotesUiDocument
Set uiDoc = ws.CurrentDocument
Call uiDoc.FieldSetText(“checkboxValues”, “ALL”)
What you did on the back end is unnecessary.
It would require a uiDoc.reload in order to display. And that’s just unnecessary code.
Subject: RE: How do you select multiple values in a Checkbox.
Of course, that just gets the one “ALL” value.For multiple values, don’t forget to Reload from the NotesDocument.
Subject: And for multiple values…
Call uiDoc.FieldSetText(“checkboxValues”, “xxx, yyy, ALL”)
where “xxx” and “yyy” are other checkbox values you want to select.
Subject: Try:
Dim A1(0) As StringA1(0) = “ALL”
doc.checkboxValues = ArrayUnique(ArrayAppend(A1, doc.checkboxValues))