0

Hey there,
I have the following problem driving me nuts!
I have 2 check boxes and each one is assigned a message (for check 1 say Hi, for check 2 say food). If I click on one of them, it displays its message in a text box, and pressing the second one, (with the 1st one still ticked) should display both messages. Problem is, one is overwriting the other, and vice-versa. Any tips?

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by breezyy
0

use if end if or case statement.
if check1.value = 1 then
text1.text = hi
else
text1.text= ""
end if

0

Hi,

You need to build the message string accordingly..
Try This :

Dim T As String
T= ""
If chk1.Value = vbChecked Then
  T = "Hi  "
End If
If chk2.Value = vbChecked Then
  T = T & " Food  "
End If

MsgBox T

Regards
Veena

0

Hi,

You need to build the message string accordingly..
Try This :

Dim T As String
T= ""
If chk1.Value = vbChecked Then
  T = "Hi  "
End If
If chk2.Value = vbChecked Then
  T = T & " Food  "
End If

MsgBox T

Regards
Veena

That was a real life saver!
In fact the error I made was using T = T And " Food " instead of T = T & " Food "
Thanks for the tip !
Cheers

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.