Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Clearing Combo box selection

smilliesmillie Member Posts: 1
Basically I am doing some validation code on the Before Update event of a combo box, the validation code is working fine and I fire up a message explaining why the user


  • dokken2dokken2 Member Posts: 532
    here's one way,

    Private Sub Combo4_BeforeUpdate(Cancel As Integer)
    Select Case Me.Combo4.Text
    Case "1": 'ok
    Case "2": 'ok
    Case "3": 'ok

    Case "4"
    MsgBox "invalid"
    Cancel = True
    SendKeys "{esc}{esc}"

    Case Else
    MsgBox "invalid"
    Cancel = True
    SendKeys "{esc}{esc}"
    End Select
    End Sub
Sign In or Register to comment.