johnqtr
asked on
Multiple Function Controls
I have two buttons, "Previous" and "Next". I have multiple textbox arrays. What I want to do is, when you click on the "Next" button the next textbox array will show, press the "Next" button again and the nex textbox after that will show, etc.
The "Previous" button needs to do the same only in reverse. As little coding as possible would be nice.
Thanks!
The "Previous" button needs to do the same only in reverse. As little coding as possible would be nice.
Thanks!
sorry for my last comment, it was for some other post.
It's probably more complicated than I think, but does approach the problem?
Private Sub cmdNext_Click()
Dim i As Integer
Dim bFlag As Boolean
Dim bFlag2 As Boolean
Const iBoxCount = 3
'ensures that there is no more than one box visible
Do Until i = iBoxCount
If bFlag2 Then
Text1(i).Visible = False
Else
If bFlag Then
Text1(i).Visible = True
bFlag2 = True
Else
If Text1(i).Visible Then
Text1(i).Visible = False
bFlag = True
End If
End If
End If
i = i + 1
Loop
'Restart at beginning
If bFlag = False Or bFlag2 = False Then
Text1(0).Visible = True
End If
End Sub
Private Sub cmdNext_Click()
Dim i As Integer
Dim bFlag As Boolean
Dim bFlag2 As Boolean
Const iBoxCount = 3
'ensures that there is no more than one box visible
Do Until i = iBoxCount
If bFlag2 Then
Text1(i).Visible = False
Else
If bFlag Then
Text1(i).Visible = True
bFlag2 = True
Else
If Text1(i).Visible Then
Text1(i).Visible = False
bFlag = True
End If
End If
End If
i = i + 1
Loop
'Restart at beginning
If bFlag = False Or bFlag2 = False Then
Text1(0).Visible = True
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this means that except for textbox(0)(example), you have to set the rest of the textbox array visible property to false at design time
no it not possible, the same question asked before on this many times, but answer was always no.
Cheers!