Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Indianapolis, Indiana, USA
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Which Event(s) to use (Access 2002)

    Does anyone know of a concise overview of the order of events that covers when to use an event and where events overlap? Especially one that deals with unbound controls. I wanted to add, is there a universal event? That is, is there an event that is triggered for all controls on a form.

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

    Re: Which Event(s) to use (Access 2002)

    The question is rather broad - there are so many events that it is hard to give general advice. The online help for some events explains in which order they occur - for example, look up the Load event, the Enter event, the BeforeInsert event and the Delete event.

    I'm not sure what you mean by a universal event. The Error event of a form can be used to trap all kinds of errors on a form, and if you set the KeyPreview property of a form to Yes, the KeyDown, KeyPress and KeyUp events of all controls get passed to the form-level events of the same name first, before being handled at the control level.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Which Event(s) to use (Access 2002)

    I have to add a qualifier to Hans's post. Only controls that can receive the focus share KeyDown and KeyPress events, not *all* controls, which includes lines, labels and other objects that don't apply. You can create custom events and raise them wherever you want. However, you have to know how to write event sinks to watch for those events. There are ways to do these things, but they are pretty advanced VBA.
    Charlotte

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

    Re: Which Event(s) to use (Access 2002)

    Thanks for the addition. I should have written "... the KeyDown, KeyPress and KeyUp events of all controls (where appplicable) ..." <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

Posting Permissions

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