Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: re: BeforeUpdate event is not working?

    Good Morning,

    Can anyone think of why BeforeUpdate event is not working?
    I have a check box in a subform when clicks it executed BeforeUpdate event but sees the check box is true. Why?
    I tested with another form the BeforeUpdate event works in check box. There is Afterupdate event for the check box in a subform but that should not be the problem.
    This is my code in subform:

    Private Sub quick_sort_BeforeUpdate(Cancel As Integer)
    If Me!quick_sort.Value = True Then
    Me!prev_dispo.Value = "Quick-Sort"
    else
    Me!prev_dispo.Value = ""
    end if
    end sub

    I just can't understand why this is not working.
    Thanks for your input.

  2. #2
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    hi

    I have a check box in a subform when clicks it executed BeforeUpdate event but sees the check box is true. Why?
    I'm not sure what you want to happen. If you've ticked the box, the value in the box will be true. Isn't this what you want ?

    Note that the value that you see in the box is the one that before update event will read . This is not the same as the underlying value in the database which won't have changed because you're still at the "before update" stage. If you want to use the original value, the use the oldvalue property of the control.
    e.g.
    originalTrueFalse=me!quick_sort.oldvalue

    Chris

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I have occasionally come across events not firing in access. It seemed to occur when code had been created in the code window, without expressly going via the form designer.

    The workaround that seemed to clear the fault was to check the properties for the control in the form designer and see if the event you are mapping shows [Event Procedure]. On occasions the form designer had not recognised the new events in the backing code module.

    Outside of that...... perhaps someone else has a better susggestion?

Posting Permissions

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