• Undo unbound combobox (2000/XP)

    Author
    Topic
    #408163

    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

    Viewing 1 reply thread
    Author
    Replies
    • #859295

      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

      • #859630

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

      • #859631

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

    • #859296

      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

    Viewing 1 reply thread
    Reply To: Reply #859296 in Undo unbound combobox (2000/XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel