Thanks, but I have already worked it out. It was only one small adjustment I had to do in my code to make it worked. I did it like this: Dim x As Integer Dim y As Integer Dim counter As Integer Dim check As Boolean Private Sub Bttn_Fkltt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bttn_Fkltt.Click x = TxtBx_Fkltt.Text counter = 1 check = False y = x * (x - 1) If x > 2 Then Do Until check = True counter = counter + 1 y = y * (x - counter) If counter = x - 1 Then check = True Exit Do End If Loop Lbl_Fkltt.Text = y Else Lbl_Fkltt.Text = y End If End Sub Look at the code: If counter = x - 1 Then. Before, I had If counter = x Then, and with that code, y was multiplied with 0 in the end, resulting in y = 0. //OT