2
votes

I am having difficulty getting the value from textbox 1 and textbox 2 to combine and display in a textbox3 on a userform. Textbox1 and Textbox2 are locked, the values are dynamic and auto-filled from radio button controls. I have tried the following but it doesn't display the combined result in textbox3 and I think it's because the values in textbox 1 & 2 are the result of counter controls on the radio buttons. See image link.

Private Sub TextBox3_Change()
    textbox3.text=Textbox1.text & Textbox2.text
End Sub

enter image description here

2
I don't think it is a good idea to set the value of textbox3 within a TextBox3_Change event procedure.user4039065
to follow what Jeeped said above, could you put this code in another method, such as whenever textbox1 or 2 is changed?CAM_344

2 Answers

1
votes

I found that the code below works best, your values will be combined. I placed a space between the values for s&g's.

Private Sub TextBox2_Change()
    Me.TextBox3.Value = Me.TextBox1.Value & " " + Me.TextBox2.Value
End Sub
0
votes

You could try to code below:

Private Sub TextBox2_Change()
   TextBox3.Value = TextBox1.text & TextBox2.text
End Sub

Hope that helps!