Results 1 to 9 of 9
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Question Fields as buttons with mouseover

    Is there a way that, rather than focus, have a field change formatting when mouse over?

    I don't see anything in conditional formatting that supports mouse over...



    I am making fields into buttons and I would like the same affect as with a button.

  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,626
    Do you mean a textbox on a form? Try the OnMouseMove event. http://www.access-programmers.co.uk/...d.php?t=112911
    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
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Do you mean a textbox on a form? Try the OnMouseMove event. http://www.access-programmers.co.uk/...d.php?t=112911
    Yeah, I do apologize for my lack of proper explanation. Textbox and thanks

    from what I have read from the link as I understand it you are creating coordinates within the field using VBA and changing what happens depending on whether you enter the coordinates or not?

    Also is there a way of removing the selector cursor icon from appearing?

    Same thing? http://www.access-programmers.co.uk/...d.php?t=122407

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    I've got mouse over working well - the textbox border changes colour nicely when mouse over. Returning it to it's original formatting when leaving is next bit.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    What do you mean 'coordinates within the field'? The code compares position of cursor with criteria and if true, code does something.

    I did a little test with textbox. I just put Debug.Print "Move" in the procedure. Everytime the mouse passed across the textbox, "Move" was output to the VBA immediate window.

    By selector cursor you mean the mouse pointer arrow? Why would you want it to go away? It can be different but don't think it can go away.
    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.

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    eh...

    eh...

    I used this and it works...
    Code:
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)    
        Me.ButtonState.BorderColor = 28   'Turns border Red
        Me.ButtonState.BorderWidth = 1     'Increases border width
    End Sub
    
    
    Private Sub ButtonState_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Me.ButtonState.BorderColor = 255   'Turns border Red
        Me.ButtonState.BorderWidth = 1     'Increases border width
    End Sub
    ... however, it works for all the fields on a continuous form rather than the particular one I am hovering over...

  7. #7
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    What do you mean 'coordinates within the field'? The code compares position of cursor with criteria and if true, code does something.
    Nevermind
    Quote Originally Posted by June7 View Post
    By selector cursor you mean the mouse pointer arrow? Why would you want it to go away? It can be different but don't think it can go away.
    Yup. Mouse pointer arrow insert thing.

    I want the formatting to go back to it's original state once the mouse moves away from the text box, which it now does - however, I want one record only - not all on a continuous form.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	9 
Size:	21.6 KB 
ID:	13432 This is how I would like it to turn out.

    All it does at the moment is change the formatting for all rather than just one record.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    That's probably because there really is only one control. It's the same when trying to change a property of a control on continuous form, the change is in effect for all instances of the control. In the same vein, the same procedure is executed for all instances of the control when cursor passes over. Don't think you can get what you want.
    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.

  9. #9
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    That's probably because there really is only one control. It's the same when trying to change a property of a control on continuous form, the change is in effect for all instances of the control. In the same vein, the same procedure is executed for all instances of the control when cursor passes over. Don't think you can get what you want.
    Yeah I guess so, I went with buttons in the end and it's working fine (and frankly it's easier to code in).

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

Similar Threads

  1. Replies: 3
    Last Post: 07-31-2013, 08:30 AM
  2. Replies: 10
    Last Post: 09-18-2012, 02:00 PM
  3. Buttons!
    By kp123 in forum Access
    Replies: 5
    Last Post: 12-08-2011, 04:22 AM
  4. Replies: 9
    Last Post: 10-29-2011, 12:47 PM
  5. Buttons
    By dunnmel4 in forum Access
    Replies: 1
    Last Post: 04-07-2011, 12:27 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