Code:Private Sub fillTextBox (strText as String, txtBox as TextBox) 'clear all of the text boxes txtMain.Text = "" txtOne.Text = "" txtTwo.Text = "" txtThree.Text = "" txtFour.Text = "" if strText = "" then txtBox.Text = strMain else strMain = strText txtBox.Text = strText End if End Sub private sub command1_click() 'pass the data in the txtMain, and the textBox to be changed filltextBox txtMain.Text, txtOne End Sub private sub command2_click() filltextBox txtMain.Text, txtTwo End Sub




Reply With Quote