Hey Everyone,
I have a form for scoring where the user would click on a text box to make the value jump by 0.5 points. I have the code working from the Sub, but I'd like to know how to make this a function and how to call the function. Otherwise I'd need to repeat the code for each text box.
Here's the code I have working. [1X1] is the text box, FRM_AddSubtract is a frame with a + and - toggle.
----------------------------------------
Private Sub Ctl1x1_Click()
If IsNull([1x1]) Or [1x1] = "" Then
If FRM_AddSubtract.Value = 1 Then
[1x1] = "0.5"
ElseIf FRM_AddSubtract.Value = 2 Then
End If
Else
If FRM_AddSubtract.Value = 1 Then
[1x1] = [1x1] + 0.5
ElseIf FRM_AddSubtract.Value = 2 Then
If [1x1] = 0.5 Then
[1x1] = ""
Else
[1x1] = [1x1] - 0.5
End If
End If
End If
End Sub
I have a form for scoring where the user would click on a text box to make the value jump by 0.5 points. I have the code working from the Sub, but I'd like to know how to make this a function and how to call the function. Otherwise I'd need to repeat the code for each text box.
Here's the code I have working. [1X1] is the text box, FRM_AddSubtract is a frame with a + and - toggle.
----------------------------------------
Private Sub Ctl1x1_Click()
If IsNull([1x1]) Or [1x1] = "" Then
If FRM_AddSubtract.Value = 1 Then
[1x1] = "0.5"
ElseIf FRM_AddSubtract.Value = 2 Then
End If
Else
If FRM_AddSubtract.Value = 1 Then
[1x1] = [1x1] + 0.5
ElseIf FRM_AddSubtract.Value = 2 Then
If [1x1] = 0.5 Then
[1x1] = ""
Else
[1x1] = [1x1] - 0.5
End If
End If
End If
End Sub