Try:
Dim options As String
options = ""
If ChkCoverstory Then options = Label3.Caption
If ChkNews Then options = Label5.Caption & options
If ChkRegulars Then options = Label7.Caption & options
Comments.Text = options & Comments.Text
"Newbee" wrote:
hello everyone as iam new to VB i have a small query which iam trying
to solve.
I have designed a form with three check boxes and one texbox which is
connected to a column in a table.
when i check one of the check boxes or all of them i want to copy the
checkbox label text to the textbox to store in the table. to achieve
this i defined a string in the on click event procedure of the CLOSE
Button on the form.
If i use this string in the on-click event procedure of the check box
its giving me this error "RUNTIME ERROR 2115". Thts the Reason i used
the string in the CLOSE command button (which doesnt give any runtime
error).
The problem comes when i click all the three check boxes the textbox is
only storing the recent value. but not all the three values. I have
attached the code please go through the string i have written in the
CLOSE Button event Procedure.
Comments.SetFocus
Dim options As String
options = Comments.Text
If chkCoverstory.Value = True Then
Comments.Text = Label3.Caption & options
If ChkNews.Value = True Then
Comments.Text = Label5.Caption & options
If ChkRegulars.Value = True Then
Comments.Text = Label7.Caption & options
End If
Any help is greatly appreciated. Thanks in advance.