Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    6

    Unanswered: Access 2000 subform validation

    I have a continuous SUBFORM that is validated in the Form_BeforeUpdate event.

    If invalid the focus is kept on the record that was changed.

    I have a cancel button on the MAIN form, to allow the user to exit without saving changes.

    If the user makes an invalid change but clicks on the cancel button, how am I able to check, during validation, that the button was pressed and so cancel the update and ignore validation.

    Because the Form_BeforeUpdate occurs first, I can't seem to find a way to check that the cancel button on the main form was clicked.

  2. #2
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    33
    Depending on number of controls in your subform you can e.g set Cancel property for your Cancel button to yes. Then user will press <ESC> to undo the changes and move focus to Cancel button or use OnKeyDown to simulate this.

  3. #3
    Join Date
    Oct 2002
    Posts
    6

    Smile

    Originally posted by Alec
    Depending on number of controls in your subform you can e.g set Cancel property for your Cancel button to yes. Then user will press <ESC> to undo the changes and move focus to Cancel button or use OnKeyDown to simulate this.
    Thank's Alex, I didn't want to use a cancel button on the subform because I have two subforms on the main form, and only wanted one cancel button.
    I ended up having an option in the validation error message boxes for the subforms to cancel changes. Then they can use the main form Exit button to close the form.
    Its not perfect, but they will have to live with it.

Posting Permissions

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