B
BillD
I am getting an error message as Follows:
Compile Error
End IF
Without block IF
Run Time Error 424
I have a combo box that lists states. When I enter the first letter for
example "M" the state Maine displays. I would like to be able to use the up
and down arrow keys on my keyboard to move through the selection of states
for example arrow down to Minnesota.
I was told by someone at this site to enter the following code:
Private Sub Combobox_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDown And ComboBox.ListIndex <> ComboBox.LisCount - 1 Then
ComboBox.ListIndex = ComboBox.ListIndex + 1
End If
If KeyCode = vbKeyUp And ComboBox.ListIndex <> -1 Then
ComboBox.ListIndex = ComboBox.ListIndex -1
End If
End Sub
As stated above I get the compile error everytime I enter a letter in the
combo box in the form: Enter an "M" and the error pops up.
Please Note I am still a novice at Access so if anyone can help me please
explain how to solve this in easy to understand terms.
Thank you
Compile Error
End IF
Without block IF
Run Time Error 424
I have a combo box that lists states. When I enter the first letter for
example "M" the state Maine displays. I would like to be able to use the up
and down arrow keys on my keyboard to move through the selection of states
for example arrow down to Minnesota.
I was told by someone at this site to enter the following code:
Private Sub Combobox_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDown And ComboBox.ListIndex <> ComboBox.LisCount - 1 Then
ComboBox.ListIndex = ComboBox.ListIndex + 1
End If
If KeyCode = vbKeyUp And ComboBox.ListIndex <> -1 Then
ComboBox.ListIndex = ComboBox.ListIndex -1
End If
End Sub
As stated above I get the compile error everytime I enter a letter in the
combo box in the form: Enter an "M" and the error pops up.
Please Note I am still a novice at Access so if anyone can help me please
explain how to solve this in easy to understand terms.
Thank you