Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21842

Select Case

$
0
0
Click a command button to move to the next account number
which are held in strings from the database loading.
The code works but shows one blank before it returns to the
first account is there any way for it to move back to the first
account number if the str record is blank? and not show the blank.
Code:

VB6
Private Sub cmdNextAcc_Click()

    Select Case True
        Case Titles.strAccNum0 = txtAccount _
          And Not Titles.strAccNum0 = vbNullString
          txtAccount = Titles.strAccNum1
        Case Titles.strAccNum1 = txtAccount _
          And Not Titles.strAccNum1 = vbNullString
          txtAccount = Titles.strAccNum2
        Case Titles.strAccNum2 = txtAccount _
          And Not Titles.strAccNum2 = vbNullString
          txtAccount = Titles.strAccNum3
        Case Titles.strAccNum3 = txtAccount _
          And Not Titles.strAccNum3 = vbNullString
          txtAccount = Titles.strAccNum4
        Case Titles.strAccNum4 = txtAccount _
          And Not Titles.strAccNum4 = vbNullString
          txtAccount = Titles.strAccNum5
        Case Titles.strAccNum5 = txtAccount _
          And Not Titles.strAccNum5 = vbNullString
          txtAccount = Titles.strAccNum0
        Case Else
          txtAccount = Titles.strAccNum0
    End Select
End Sub


Viewing all articles
Browse latest Browse all 21842

Trending Articles