I failed this question on a test. I still can't figure out the answer. I don't care what the answer is I want to understand how you get the answer. Can someone please explain each step in this code.
Private Sub cmdQuestion5_Click()
Dim intEntry As Interger
intEntry = 7
Select Case intEntry
Case 1
lblBox.Caption = 1 + intEntry
Case 2
lblBox.Caption = 2 + intEntry
Case 3
lblBox.Caption = 3 + intEntry
Case 4 To 8
if intEntry > 7 Then
lblBox.Caption = 8 + intEntry
ElseIf intEntry > 6 Then
lblBox.Caption = 7 + intEntry
Else
lblBox.Caption = 6 + intEntry
Else if
Case Else
lblBox.Caption = 20
End Select
End Sub
Visual Basic ClassicMicrosoft AccessVBA
Last Comment
James Coats
8/22/2022 - Mon
Rey Obrero (Capricorn1)
this is where the code will be executed
ElseIf intEntry > 6 Then
lblBox.Caption = 7 + intEntry
the lblBox.Caption=14
but if this is not a typo
Dim intEntry As Interger
you will get an error and the code will not execute
ElseIf intEntry > 6 Then
lblBox.Caption = 7 + intEntry
the lblBox.Caption=14
but if this is not a typo
Dim intEntry As Interger
you will get an error and the code will not execute