Link to home
Create AccountLog in
Avatar of mustish1
mustish1

asked on

Cascading

Can you please tell me why my list box is keep refreshing, every time I click on it?

Private Sub Combo34_AfterUpdate()
Dim strSQL As String
   Select Case Me.Army_Training_Program_ID

        Case 1 'Army

            strSQL = "SELECT * FROM ClassNames WHERE ClassID IN (7, 8, 9, 10, 11) ORDER BY ClassName;"

        Case 2 'Airforce

            strSQL = "SELECT * FROM ClassNames WHERE ClassID IN (8, 9, 10) ORDER BY ClassName;"

        Case 8 'Navy

            strSQL = "SELECT * FROM ClassNames WHERE ClassID IN (12, 13, 14, 15) ORDER BY ClassName;"

        Case Else

            strSQL = ""

    End Select
    
    Me.ListClass.RowSource = strSQL
End Sub

Open in new window

User generated image


SOLUTION
Avatar of Am P
Am P
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of mustish1
mustish1

ASKER

Can you please tell me the IF statement
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account