Results 1 to 3 of 3
  1. #1
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94

    Event 1 or Event 2 or Event 3


    I have three action buttons on my form call then but1, but2 and but3. I want the same event to happen if the user pushes either of the three buttons. Is there a short hand method to write one set of code with an "or" type statement?

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,369
    Hopefully these buttons are calling the same function, which then decides on what to do based on the button rather than simply running the same block of code.
    Anyway, what I think you want to do is select all 3 in design mode and enter the name of the function in the click event property on the property sheet' e.g. =MyFunction(). Note that it has to be a function in a standard module. It cannot be a sub nor can it be a function on a form/report.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Create a form level function/sub and call it from each of the 3 buttons.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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: 13
    Last Post: 09-10-2015, 03:37 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