Howdy, Stranger!

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

Categories

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

Comments

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


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

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

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