Ed
asked on
Concatenate Checkbox Values into Text Area
I have checkbox that when' Checked' sets the value of the checkbox into a textarea.
The problem is that when more than 1 checkbox is checked it overwrites the value in txtNotes.Text with the latest checkbox value
What I would like to do is list ALL the values of the 'Checked' checkboxes, not just the last one. Whats the best way to achieve this?
Protected Sub chkReviewdate_CheckedChanged(sender As Object, e As EventArgs) Handles chkReviewdate.CheckedChanged
CheckActions()
txtNotes.Text = "Review date to be added or incorrect"
End Sub
The problem is that when more than 1 checkbox is checked it overwrites the value in txtNotes.Text with the latest checkbox value
What I would like to do is list ALL the values of the 'Checked' checkboxes, not just the last one. Whats the best way to achieve this?
This should append the text as a new line
txtNotes.Text = txtNotes.Text & "\r\nReview date to be added or incorrect"
txtNotes.Text = txtNotes.Text & "\r\nReview date to be added or incorrect"
ASKER
Thanks, I'll try that. I would also like to add each value to a new line in the text area if that is possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
txtNotes.Text = txtNotes.Text & vbNewLine & "Append new value"
works perfectly. Thanks
Not a problem Ed, glad to help.
Try it something like this.
Open in new window