Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conflicting conditions (Access 2000)

    I have a function that allows the user to give up the recording and close the form, however the before update event of the subform has a condition
    that requires the user to have filled the quantity.
    Sometimes the user has chosen a product, but at that moment decides to leave, to give up, and go out of the order.For this rare ocasions i have tried to use the button Close,but cannot succeed
    since it contradicts with the other condition.
    I have stripped the database and enlosed it.It concerns the button "Close" on the main form. Can i somehow make the button work inspite of
    the before update event of the form? I want to preserve the before udate function and yet . Cn you help me find a solution?

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

    Re: Conflicting conditions (Access 2000)

    The user cannot click on a button in the main form as long as the conflict in the subform hasn't been resolved. You can get around this by asking the user if the record should be canceled:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    If IsNull(Me!Quantity) And Me!cartons = 0 Then
    If MsgBox("You haven't entered cartons! Do you want to cancel this record?", _
    vbYesNo + vbQuestion) = vbYes Then
    Me.Undo
    Else
    Me.cartons.SetFocus
    End If
    Cancel = True
    Exit Sub
    End If
    Me.branch0 = Me.branch0 - Me.cartons
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conflicting conditions (Access 2000)

    This is a special thanks to you and this Forum.You cannot imagine how many hours i did spend on futile efforts to resolve this conflict. I wish you all the best

Posting Permissions

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