Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009
    Location
    Antwerp (Belgium)
    Posts
    33

    Question Unanswered: Form : interrupting the event stream

    I'd like the validation "subs" of my key field to be triggered only if the user pressed "Enter". To that effect I "dim" a "mnLastkey" at form module level, set that variable in the 'keypressed' sub of the form and test the variable's value in the key textbox sub (before_update, lost_focus).

    Is there a more efficient way in MS Access to "abort" the event stream from a form level snippet?

    In fact what I'm trying to achieve is to avoid that keyfield validation occurs when the user "is in the keyfield" and decides to check out another form (thereby deactivating the form). This is one of the occurrences in which I would need to "interrupt the events stream".

    Thanks for any light that can be shed on this.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    consider moving the validation code to the form before update event, or the controls before update event rahter than an individual on lost focus event.

    I know some GUI design principles suggest you should validate each and every control as you loose focus, however in practice I find users unhappy at receivign a barrage of individual warning messages.

    another approach,if you must validate on each control is to validate on each control but set the background colour of the control to say red, set the controls tooltip text to be the error message, rememebr to reseet these when the values pass validation.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2009
    Location
    Antwerp (Belgium)
    Posts
    33
    Thanks.

    I don't think "validating" at the form "before update" level is an option for me. Conceptually I'm using unbound forms, but use a "local table" (let's call that a cursor) that I bind to my form. For example when the system generates a new key (not the primary key, but an alternate key), then I need to "update" the cursor, which I cannot do "before update".

    Or am I missing something.

Tags for this Thread

Posting Permissions

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