+ Reply to Thread
Results 1 to 2 of 2

Capture user click event problem, "the expression you entered requires the control to

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2003
    Posts
    15

    Capture user click event problem, "the expression you entered requires the control to

    Hi everyone. I'm hoping I put the title correctly. I have an Access database file in 2003. The form and everything else work fine and everyone is using it. Now I want to capture to see which form the user use a lot and on that form which button they click a lot too, so I can delete the forms that no one use, for the sake of file size. So my idea is first off I will make a table call CapturingUsage with 2 text field for formName and buttonName.


    I want write a Sub or Function and put it underneath the onMouseDown of each button. Oh, btw, the buttons is image and the onClick event has been occupied by the Macro, that's why I use onMouseDown instead. So anyway, I want to use code to input a row into the CaturingUsage table every time someone click something in some form. It won't work. As the error stated that "the expression you entered requires the control to be in the active window"


    I have no idea how to fix. Following is the code.


    Please Login or Register  to view this content.


    And here is the Sub to do the Insert thing
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-26-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Capture user click event problem, "the expression you entered requires the contro

    I actually found a solution, not saying a good one but it worked for me. So at the line:
    Please Login or Register  to view this content.
    Instead of putting Screen.ActiveControl.Name which caused problem, I just put the actual name of the image which is imengrs. Basically I want to capture the name of this image button when they click on it so manually type in the name and it does the work. But I'm still hoping to know your better solution, for I have like 10 buttons on ea form and about 70 forms or so.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1