Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Undo unbound combobox (2000/XP)

    The code below doesn't undo the change in the combobox, is it because the control is unbound? I've managed to undo bound combos successfully but can't get this to work. Both the combo and the form on which it sits are unbound.

    Private Sub cboELR_BeforeUpdate(Cancel As Integer)

    If (some test here) Then
    Cancel = True
    Me!myCombo.Undo
    End If

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Undo unbound combobox (2000/XP)

    Yes, Undo only works for bound controls. You can either use Before Update to set Cancel = True, forcing the user to enter something else, or use After Update to clear the combo box:

    Private Sub cboELR_AfterUpdate()
    If (some test here) Then
    Me!cboELR = Null
    End If
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Undo unbound combobox (2000/XP)

    Thanks, I thought that might be the case but I just wanted to check I wasn't missing something obvious.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •