Results 1 to 4 of 4
  1. #1
    Join Date
    May 2002
    Location
    London
    Posts
    87

    Unanswered: Canceling update on Option group

    I have an option group of two buttons assigned values 0 and -1. I wanted to validate the form if the button was pressed and ask the use to confirm the switch if necessary.

    Now the problem is that I don't know how to cancel this update. By the time I'm processing the beforeupdate event, the .oldvalue property is now the same as the newvalue and .undo does nothing.

    I'd be delighted to accepot and assistance on this one.

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Risky,

    Just checking...
    Are you using:

    Cancel = True

    before your .Undo in your BeforeUpdate Event?
    Inspiration Through Fermentation

  3. #3
    Join Date
    May 2002
    Location
    London
    Posts
    87
    I'll try that, thanks.

  4. #4
    Join Date
    May 2002
    Location
    London
    Posts
    87
    None of that worked so I finally managed it with
    Code:
    Private Sub cmdLong_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If cmdLong.Locked = True Then
        If txtClassTot <> txtTotal Then
            varReturn = MsgBox("The balance had not yet been completely adjusted.  Continue?", vbOKCancel + vbDefaultButton2)
        End If
        If varReturn = vbOK Or txtClassTot = txtTotal Then
            cmdLong.Locked = False
            cmdShort.Locked = True
        End If
    End If
    End Sub
    
    Private Sub cmdShort_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If cmdShort.Locked = True Then
        If txtClassTot <> txtTotal Then
            varReturn = MsgBox("The balance had not yet been completely adjusted.  Continue?", vbOKCancel + vbDefaultButton2)
        End If
        If varReturn = vbOK Or txtClassTot = txtTotal Then
            cmdShort.Locked = False
            cmdLong.Locked = True
        End If
    End If
    End Sub

Posting Permissions

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