Link to home
Start Free TrialLog in
Avatar of johnqtr
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!
Avatar of shivsa
shivsa
Flag of United States of America image

Hi trixits,
no it not possible, the same question asked before on this many times, but answer was always no.

Cheers!
sorry for my last comment, it was for some other post.
Avatar of GrahamSkan
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
ASKER CERTIFIED SOLUTION
Avatar of lttia1
lttia1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lttia1
lttia1

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