I am trying to teach myself VB, so if it sound like I've no idea what I am talkin about....thats why.

I have four text box's and four buttons next to them.
I have one txtMain box. when the user types something into txtMain and then clicks any button the text is moved from txtMain to the corresponding text box for the button.
(cmdOne moves txtMain.text to txtOne.text..ect.)
it also clears the last text box so there is text only in one box at a time.
I use a variable and for each button it looks first in the main text box and if there is something there it puts that string into a variable. then it puts that variable into the txtOne,txtTwo..ect.
(this part works, I get an A++ for class)
now what I want to do now is use a sub or funtion to set the variable then call (or however it is done) the function with the click of the various buttons.
this is what the code for one button looks like. I had to copy this for all four buttons. How can I use a sub/function
to make less code?

Private Sub cmdOne_Click()

If txtMain = "" Then 'check the txtMain box
txtOne.Text = strMain
Else
strMain = txtMain.Text 'load variable strMain
txtOne.Text = strMain 'load txtOne box

End If 'clear txtbox's
txtMain.Text = ""
txtTwo.Text = ""
txtThree.Text = ""
txtFour.Text = ""
End Sub

Thanks to anyone that helps. (if you can even understand what I just said...
pnj