Results 1 to 5 of 5
  1. #1
    Pauliolio is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3

    Question Button click event not being listened for? 2003->2007->2013

    Hi



    I'm working with an application that was (I think) originally developed in Access 2003. There's a 2007 version of it that I'm trying to iron the bugs out of in Access 2013.
    There's a form to display the list of customers that has buttons in the form footer one for each of the letters A-Z. Clicking one of the buttons filters the displayed list to the letter clicked.

    The application has macros in it some of which are related to some of the forms.
    When viewing the list of macros there's a toolbar option to 'Convert Macro to Visual Basic'. With the macro for the form mentioned above selected, converting it creates a module called 'Converted Macro - [macro name]'.

    The macro (now the module) was doing this:

    Click image for larger version. 

Name:	CustomerFormConvertedMacro.jpg 
Views:	12 
Size:	62.4 KB 
ID:	22106


    Now then... I've stopped the macro from being run and want to do the following when, for example, the 'A' button is clicked:

    Click image for larger version. 

Name:	A-ClickCode.jpg 
Views:	12 
Size:	44.3 KB 
ID:	22107

    The thing is though, that although I've selected the object ('A') and event ('Click') from the dropdowns the code is not run.
    If I select the 'A' button in the designer though, 'Click' is not a listed event:

    Click image for larger version. 

Name:	AButtonEvents.jpg 
Views:	12 
Size:	30.3 KB 
ID:	22108

    If I click the ellipses for one of the listed actions (MouseUp) and in the event code call the Click event sub - It runs.
    It would appear that although the Click event is listed against the object in the VB environment, not all events listed have 'listeners'. All of the events listed against the object in the form designer do.

    Can anyone tell me how to get the Click event responded to please?


    Many thanks...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Set the button Click event property to [Event Procedure] and put code in the procedure and then mouse click the button.

    Your image shows A is a toggle button. I've never needed a toggle button. However, I just created one and it shows the Click event on Properties Sheet. If you put the toggle button within an Option Group frame, the toggle will not have a Click event. The Option Group has it.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Pauliolio is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3
    Quote Originally Posted by June7 View Post
    Set the button Click event property to [Event Procedure] and put code in the procedure and then mouse click the button.

    If there is no Click event then A is not a command button. Your image shows it is a toggle button. I've never needed a toggle button.

    Umm... Thanks for taking the time to answer, but... Did you read my question?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    I edited my previous post while you were reading. Might review again.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Pauliolio is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3
    Many thanks June7! Dat der bunny!

    I didn't notice the option group frame - It looked like the background grid. That does indeed have the Click event, and it is calling the code

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

Similar Threads

  1. 2002-2003 to 2007-2013 conversion
    By hennap in forum Access
    Replies: 4
    Last Post: 11-05-2014, 05:54 PM
  2. an activex button click event error
    By amd711 in forum Programming
    Replies: 2
    Last Post: 11-23-2012, 10:40 PM
  3. Trigger event with button click
    By AMAS in forum Forms
    Replies: 8
    Last Post: 06-07-2012, 09:42 AM
  4. Command button click event
    By R_jang in forum Programming
    Replies: 10
    Last Post: 10-29-2010, 10:13 PM
  5. On Click Event For Button On Form
    By Desstro in forum Forms
    Replies: 3
    Last Post: 08-09-2010, 02:36 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