Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 65
  1. #31
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209


    Quote Originally Posted by orange View Post
    ?? I am still confused with your requirement??
    Based on the sample provided by Apr Pillai

    m_txt represents any textbox on your form, m_txt_MouseMove is the mouse movement event on the textbox where the mouse is

    So as Apr Pillai said


    This is interesting


    Do you have a graphic or drawing that shows your proposed interface or design? That may help put things into perspective. Perhaps I'm the only one not following your requirement or the importance of
    "Is there a way to get the name of the control into the call parameter?" - a sample showing your expected interface would help.

    As I see ChrisO's Macbeth seating example(linked in post#4), you could easily have many more textboxes and display info based on MouseMove event.
    Attachment 39888
    The MouseMove Event will continuously fire the RunMouseOver() code on each coordinate of the mouse position on the Text Box. Probably you need the function/subroutine to execute only once on a particular text box. Check whether you want to use the MouseMove Event or consider using some other Event like OnGotFocus.


    Sent from my iPhone using Tapatalk

  2. #32
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    apr,

    Agree - Focus is probably better. Doesn't appear to be a need to fire for every position within the textbox.

  3. #33
    pdanes is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by orange View Post
    ?? I am still confused with your requirement??
    Based on the sample provided by Apr Pillai

    m_txt represents any textbox on your form, m_txt_MouseMove is the mouse movement event on the textbox where the mouse is

    So as Apr Pillai said


    This is interesting


    Do you have a graphic or drawing that shows your proposed interface or design? That may help put things into perspective. Perhaps I'm the only one not following your requirement or the importance of
    "Is there a way to get the name of the control into the call parameter?" - a sample showing your expected interface would help.

    As I see ChrisO's Macbeth seating example(linked in post#4), you could easily have many more textboxes and display info based on MouseMove event.
    Attachment 39888
    My graphic is similar to the one shown in this example. However, neither the graphic nor any other part of the interface have anything to do with the question:
    "Is there a way to get the name of the control into the call parameter?"
    I don't know how I can make this any clearer.

    If I put =RunMouseOver(Name) into the event property box at design time, when the MouseMove event fires, it calls the RunMouseOver function and passes the name of the parent form as a parameter, specified by the reserved word Name.

    If I use =RunMouseOver("FRED"), it will call RunMouseOver with the constant "FRED" passed as a parameter.

    If I use =RunMouseOver(3), it will call RunMouseOver with the constant 3 passed as a parameter.

    If I use =RunMouseOver("TextBox7"), it will call RunMouseOver with the constant "TextBox7" passed as a parameter. (That is what Micron's code does.)

    I want to do something like =RunMouseOver(ControlName), where the ControlName is a reserved word retrieving the name of the textbox that is currently being moused over, or =RunMouseOver(ControlTipText), where the ControlTipText is a reserved word retrieving the tooltip of the textbox that is currently being moused over.

    That is all. I don't want advice on my user interface. I don't want alternate ways to pass this information. I want to know if THIS SYNTAX works. It obviously works for the one reserved word, Name, that I have tried. I want to know if THIS SYNTAX works for other sorts of information.

  4. #34
    pdanes is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by apr pillai View Post
    The MouseMove Event will continuously fire the RunMouseOver() code on each coordinate of the mouse position on the Text Box. Probably you need the function/subroutine to execute only once on a particular text box. Check whether you want to use the MouseMove Event or consider using some other Event like OnGotFocus.


    Sent from my iPhone using Tapatalk
    Focus requires that the user click in the textbox. I don't want them to have to do that - a click means something specific, and initiates an action. I want them to know which row and column they are in as they move the mouse over the array, SO THAT they will know which textbox to eventually click in.

  5. #35
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Did you review ChrisO's
    Public Function MakeFunctionCall and how he uses it in the Form_Open event?

    He's just iterating over the rows and seats (1-40 in his case), but it could be for any number of rows and columns.
    I don't see where he hit a wall??

  6. #36
    pdanes is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by orange View Post
    Did you review ChrisO's
    Public Function MakeFunctionCall and how he uses it in the Form_Open event?

    He's just iterating over the rows and seats (1-40 in his case), but it could be for any number of rows and columns.
    I don't see where he hit a wall??
    Yes, I did. His code does a similar thing to Micron's - on start-up, it loads a call to a function, with the position name as a constant parameter. It's perfectly valid approach, and works quite well. There are a number of variations, all of which give the same results. Nothing wrong with any of them. I don't see any indication of any 'wall'. What do you mean?

    But it has nothing to do with the question that I have repeated so many times:
    "Is there a way to get the name of the control into the call parameter?"

  7. #37
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Re the wall
    from your earlier post
    That's closer - he is doing something quite similar to me, and it looks like he ran into a similar wall.
    I guess I'll just leave things as they are. I'm obviously missing something fundamental to your requirement or your approach to solution. You have viable approaches and that is really the objective in participating in the forum.

  8. #38
    pdanes is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by orange View Post
    Re the wall
    from your earlier post


    I guess I'll just leave things as they are. I'm obviously missing something fundamental to your requirement or your approach to solution. You have viable approaches and that is really the objective in participating in the forum.
    Oh, right - forgot about that. I meant that he used the technique of loading constants in code at startup, BECAUSE he was unable to specify the name of the control at design time. I think he would have liked to use the technique I described in #33, and resorted to loading in code, because he couldn't come up with a design-time technique, other than manually loading those same constants, which is a huge PIA for so many controls.

  9. #39
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    A revised version of the earlier Database: MouseMove1.zip is attached.

    The MouseMove Sub-routine: m_txt_MouseMove() in the Class Module is modified to call your Function: RunMouseOver(txtName), that is in Standard Module1. The TextBox name is passed as parameter to your Function and displayed the name on Form3 top Label's Caption. You may modify the code in your function to do whatever you would like to do.

    The repeated MouseMove Event firing is somewhat made silent in the Class Module m_txt_MouseMove() Event Procedure.

    Hope this will help you to solve your coding issue.
    Attached Files Attached Files

  10. #40
    pdanes is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by apr pillai View Post
    A revised version of the earlier Database: MouseMove1.zip is attached.

    The MouseMove Sub-routine: m_txt_MouseMove() in the Class Module is modified to call your Function: RunMouseOver(txtName), that is in Standard Module1. The TextBox name is passed as parameter to your Function and displayed the name on Form3 top Label's Caption. You may modify the code in your function to do whatever you would like to do.

    The repeated MouseMove Event firing is somewhat made silent in the Class Module m_txt_MouseMove() Event Procedure.

    Hope this will help you to solve your coding issue.
    Thank you, that is also a useful way to do it. My coding issue has long been solved - I now have a number of ways to accomplish my original task, thanks to you and others, all of which are interesting and have added to my knowledge of Access and VBA.

    However, I still have no answer to the question of whether it can be done with a reserved word at design time: without a class, without a collection, without run-time modifications of the event handler property, without loading constants unique to each control.

    I don't know if I am not explaining it correctly, or if people are trying to trying to convince me to do it a different way than what I want, or what. I am including a graphic that may help explain what my goal is. If that doesn't work, then I am stumped on how to explain myself.

    Click image for larger version. 

Name:	MousemoveEvent.png 
Views:	28 
Size:	180.6 KB 
ID:	39893

  11. #41
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209

    Textbox name into event parameter

    I don’t think there is any direct reference to the textbox we can use as parameter, when the mouse moves over the textbox, besides all possible alternatives suggested on this thread.

    Good luck.

  12. #42
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Quote Originally Posted by pdanes View Post
    Thank you, that is also a useful way to do it. My coding issue has long been solved - I now have a number of ways to accomplish my original task, thanks to you and others, all of which are interesting and have added to my knowledge of Access and VBA.

    However, I still have no answer to the question of whether it can be done with a reserved word at design time: without a class, without a collection, without run-time modifications of the event handler property, without loading constants unique to each control.

    I don't know if I am not explaining it correctly, or if people are trying to trying to convince me to do it a different way than what I want, or what. I am including a graphic that may help explain what my goal is. If that doesn't work, then I am stumped on how to explain myself.
    OK, you are looking for a property like the "ActiveControl" of "Screen" class, but there is no property like "PointerControl", and, obviously, there is no something like that for performance reasons, and when something does not exist, you have to write code to create it, and you already have some of the better ways to achive this.

    Good luck with your project!

    John

  13. #43
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If function has argument, pass parameter with explicit text or reference to property.

    For control's name, use explicit text.
    =RunMouseOver("Text_l_2")

    Following reads form's property:
    =RunMouseOver([Tag])

    This reads control's property:
    =RunMouseOver([Forms]![Form3]![Text_l_2].[Tag])

    VBA can use ActiveControl property but not seeing that available to macros or event property.


    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.

  14. #44
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I don't think there is any "key word or parameter or direct technique" to do what you are asking as others have said.
    The last approach from Apr handles things through code and there isn't all that much code.
    Any way you have working options.
    Good luck with your project.

  15. #45
    pdanes is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by June7 View Post
    If function has argument, pass parameter with explicit text or reference to property.

    For control's name, use explicit text.
    =RunMouseOver("Text_l_2")

    Following reads form's property:
    =RunMouseOver([Tag])

    This reads control's property:
    =RunMouseOver([Forms]![Form3]![Text_l_2].[Tag])

    VBA can use ActiveControl property but not seeing that available to macros or event property.
    Yes, this is the sort of syntax I was after. ActiveControl is also available and works, but the active control is not necessarily the one that is being moused over.

    All the examples you cite work, but they all require that the control be specifically named, whether as a constant or using the dot and bang syntax. THAT is what I am trying to get around. What I am trying to figure out is not this:

    =RunMouseOver([ActiveControl].[Tag])
    =RunMouseOver([ActiveControl].[Name])
    =RunMouseOver([ActiveControl].[ControlTipText])

    but this
    (aircode):

    =RunMouseOver([ControlBeingMousedOver].[Tag])
    =RunMouseOver([ControlBeingMousedOver].[Name])
    =RunMouseOver([ControlBeingMousedOver].[ControlTipText])

    Several people have provided ways to accomplish this, but they all require some amount of extra work in code. I am trying to figure out if it can be done WITHOUT code. The system obviously knows what control is being moused over, without any help from the programmer's VBA code. It seems to me that that information should be exposed and available to be referenced, but so far, I have not been able to determine how.

Page 3 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Issues with change event of textbox
    By udigold1 in forum Programming
    Replies: 4
    Last Post: 03-27-2019, 08:39 AM
  2. Query with parameter from Form Textbox
    By Juan4412 in forum Queries
    Replies: 1
    Last Post: 07-10-2013, 02:33 PM
  3. Help with Onclick event to refresh textbox.
    By mikeone610 in forum Access
    Replies: 3
    Last Post: 02-07-2013, 03:58 PM
  4. Replies: 3
    Last Post: 05-07-2012, 12:17 PM
  5. How to call After update event to the textbox
    By pwalter83 in forum Forms
    Replies: 1
    Last Post: 12-20-2011, 11:16 AM

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