Agreed. the problem seems to be that you are going into the loop with no chance of coming out. I see in the code you gave in the first post you only read once with:
strComAmount = Me.txtCommission.Text
decComAmount = Convert.ToDecimal(strComAmount)
after this you go into the loop. thus I don't see what you are trying to average.
The message box would work well but perhaps with an add amount button to add the number and a finish button to finish reading new numbers.
Otherwise if you really wanted to do the textbox idea then perhaps you should do something like the following (in psudo code)
1.user puts in data
2. if the user hits enter key (i.e. in the textbox_enter routine) the following is done:
-convert the entry to your decimal
-add the entry to an arraylist
-incriment the number of entries
-clear the text box
-re-select the textbox 'This is cos it will loose focus when the enter key is pressed
when the user is done then they can press a "Calculate" button. ' this way you will know when to get ready for another entry and when to calculate.
when you hit "Calculate" you will then do something like:
dim thetotal as decimal
for i=0 to myArraylist.count-1
thetotal = theTotal+myArraylist.item(i).todecimal
next
average = thetotal/(myArraylist.count-1)
again this is probably not that syntactically correct as I am writing this on the fly but the logic is about right.
also don't forget that if the user does not hit enter on their last entry you would not have read that value in. you can easily test this by checking that the textbox is in fact blank. if it isn't then do the textbox enter routine before you do your final calculate to ensure that the last entry is there.
hope this helps you do what you want. let me know if you have any questions.