Results 1 to 2 of 2

Thread: cancel event

  1. #1
    Join Date
    May 2009
    Posts
    72

    Unanswered: cancel event

    hi everybody
    i have a form PURCHASE with a subform PURCHASE DETAILS.
    in the subform there are the following fields
    qty
    tqd
    status----- yes/no field

    i have put the following code

    Private Sub STATUS_GotFocus()
    If Me.TQD = Me.QTY Then
    Me.STATUS.Value = True
    Else
    Me.STATUS.Value = False
    End If

    End Sub

    the problem is that in case the user misses to put focus on "status" then it is not updated..... so i put the below code

    Private Sub Form_Close()
    If Me.TQD = Me.QTY Then
    If Me.STATUS.Value = False Then
    MsgBox "SUPPLIED QTY HAS REACHED THE OREDER QTY"
    End If
    End If
    End Sub

    what i want is that if the above logic is true then
    the form close event should cancel
    the field "status" should get focus
    the form can be closed only if the "status" field is updated

    thanks in advance

    hemanth

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I think you want the before update event:

    Before update
    Paul

Posting Permissions

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