Results 1 to 5 of 5
  1. #1
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737

    Why is There a Default Event in VBE??


    This has bugged me for a lonnnnnggg time. Why is it that if I pick a control from the editor list I automatically get an event I probably don't want??

    I could sorta understand (but still be annoyed) if that event was 1st in the list, but if it's a combo f'rinstance, I get BeforeUpdate, but AfterUpdate is 1st alphabetically so it makes no sense. I've often looked for a setting that controls this; also have Googled and no luck.

    Does this happen to everyone? If not then what do affected people do - leave it there forever? Clean up all at the end? Immediately delete (it will only happen again if you pick another control)? I know, some of you are going to say always initiate an event from the property sheet which I usually do, but not always. When I have not, the event I created in vbe has never failed to link to the control - at least not that I can recall.

    However, this also happens when I'm looking at somebody else's code and I want to see what events a specific control has. Choose the control and the created events are bolded in the events list. If it had no BeforeUpdate (for example) event, then choosing the control gives it one. Regardless of how one rolls, it makes no sense and I'd like to turn it off.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Yes it is very irritating and AFAIK there is no way of changing the behaviour.
    I normally create events from the property sheet for the reasons you mention.
    When I forget I delete the default BeforUpdate event immediately.
    Whether done at once or in a later tidy up, the important thing is not to leave empty unused events as these can at times have adverse effects I believe
    Last edited by isladogs; 05-24-2019 at 10:19 AM. Reason: Spelling
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Yes it is very irritating
    Nice to know I'm not he only one.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by isladogs View Post
    ...........the important thing is not to leave empty unused events s thee can at times have adverse effects I believe
    Can you tell us anything more about the adverse effects one might experience?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Hi Bob
    As I always remove empty procedures, I can only report what I've read.
    The problems seem to be when converting to ACCDE
    See https://www.experts-exchange.com/que...e-problem.html and https://www.devhut.net/2018/10/31/ms...-run-as-accde/
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Key Press Event and/or Key Up Event not firing as expected
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 01-16-2018, 04:11 AM
  2. Replies: 3
    Last Post: 08-21-2014, 07:42 PM
  3. Replies: 7
    Last Post: 05-08-2014, 10:34 AM
  4. Replies: 1
    Last Post: 03-29-2014, 07:46 PM
  5. Replies: 3
    Last Post: 05-07-2012, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums