I have a Lightcode variable that can be 1 to 9-9-9-9-9-9 on an Input box with 6 Spinbuttons next to 6 input Text Boxes, representing each digit,the code associated with each textbox and spin button limits the min 0 and max9 and they are set visible False unless the digit immediately to the left has a digit greater than zero. The code was repeated 6 times but worked superficially in that digit 1 and 3 might have a digit and digit 2 can disappear leaving digit 3 in place to cause an error. I am faced with adding further code to loop 2:6,3:6....5:6 on the way up and on the way down again, a lot of code(messy), which makes me think that I am missing something simpler.
Any suggestion would be welcome.
A sample of the first set of code(repeated 5 times) is shown below..
'This procedure decrements the LightCode shown in
'LightCode1 when you decrease the value of the
'SpinButton.
Private Sub LCSpinButton1_SpinDown()
If LightCode1.Value = 0 Then
LightCode1.Value = 0
LightCode2.Visible = False
LCSpinButton2.Visible = False
Else
LightCode1.Value = (LightCode1.Value) - 1
End If
End Sub
'This procedure increments the LightCode shown in
'LightCode1 when you increase the value of the
'SpinButton(max9).
Private Sub LCSpinButton1_SpinUp()
If LightCode1.Value = 9 Then
LightCode1.Value = 9
Else
LightCode1.Value = (LightCode1.Value) + 1
End If
If LightCode1.Value = 1 Then
LightCode2.Visible = True
LCSpinButton2.Visible = True
End If
End Sub
regards
BDrew
Any suggestion would be welcome.
A sample of the first set of code(repeated 5 times) is shown below..
'This procedure decrements the LightCode shown in
'LightCode1 when you decrease the value of the
'SpinButton.
Private Sub LCSpinButton1_SpinDown()
If LightCode1.Value = 0 Then
LightCode1.Value = 0
LightCode2.Visible = False
LCSpinButton2.Visible = False
Else
LightCode1.Value = (LightCode1.Value) - 1
End If
End Sub
'This procedure increments the LightCode shown in
'LightCode1 when you increase the value of the
'SpinButton(max9).
Private Sub LCSpinButton1_SpinUp()
If LightCode1.Value = 9 Then
LightCode1.Value = 9
Else
LightCode1.Value = (LightCode1.Value) + 1
End If
If LightCode1.Value = 1 Then
LightCode2.Visible = True
LCSpinButton2.Visible = True
End If
End Sub
regards
BDrew