csawyer
02-21-2004, 03:14 AM
Hey all,
I'm trying to add numbers to a textbox everytime a button is clicked. i have an example of the code that i am currently using, but i would have to use this type of if statements for every number that i need inserted.
I want to be able to add 0.1 to a textbox until it reads 0.5 and then when they click it the 6th time i want it to show the next whole number, eg 1.0
Can someone show me a shortcut on how to do this because i don't want to be using these if then statements for every number up to 100
Private Sub cmdDotBall_Click()
If frmBowlingSummary.lblBowler1.Caption = ">" Then
frmBowlingSummary.txtOvers1.Text = "0.1"
Else
If frmBowlingSummary.txtOvers1.Text = "0.1" Then
frmBowlingSummary.txtOvers1.Text = "0.2"
Else
If frmBowlingSummary.txtOvers1.Text = "0.2" Then
frmBowlingSummary.txtOvers1.Text = "0.3"
Else
If frmBowlingSummary.txtOvers1.Text = "0.3" Then
frmBowlingSummary.txtOvers1.Text = "0.4"
Else
If frmBowlingSummary.txtOvers1.Text = "0.4" Then
frmBowlingSummary.txtOvers1.Text = "0.5"
Else
If frmBowlingSummary.txtOvers1.Text = "0.5" Then
frmBowlingSummary.txtOvers1.Text = "1.0"
End If
End If
End If
End If
End If
End If
End Sub
Thanks.
Cam.
I'm trying to add numbers to a textbox everytime a button is clicked. i have an example of the code that i am currently using, but i would have to use this type of if statements for every number that i need inserted.
I want to be able to add 0.1 to a textbox until it reads 0.5 and then when they click it the 6th time i want it to show the next whole number, eg 1.0
Can someone show me a shortcut on how to do this because i don't want to be using these if then statements for every number up to 100
Private Sub cmdDotBall_Click()
If frmBowlingSummary.lblBowler1.Caption = ">" Then
frmBowlingSummary.txtOvers1.Text = "0.1"
Else
If frmBowlingSummary.txtOvers1.Text = "0.1" Then
frmBowlingSummary.txtOvers1.Text = "0.2"
Else
If frmBowlingSummary.txtOvers1.Text = "0.2" Then
frmBowlingSummary.txtOvers1.Text = "0.3"
Else
If frmBowlingSummary.txtOvers1.Text = "0.3" Then
frmBowlingSummary.txtOvers1.Text = "0.4"
Else
If frmBowlingSummary.txtOvers1.Text = "0.4" Then
frmBowlingSummary.txtOvers1.Text = "0.5"
Else
If frmBowlingSummary.txtOvers1.Text = "0.5" Then
frmBowlingSummary.txtOvers1.Text = "1.0"
End If
End If
End If
End If
End If
End If
End Sub
Thanks.
Cam.