Results 1 to 7 of 7
  1. #1
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49

    How to switch off focus on the Form Startup button?

    Dear forum, I have a menu with 6 buttons, when I close an open Form the Form launch button stays lit, and sometimes 3 Form launch buttons stay lit.

    Is there a possibility to turn off the lighting.

    Here the VBA Form startup data:

    Private Sub Visvangst_gegevens_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    On Error GoTo Fout
    DoCmd.OpenForm "VisvangstInvoerF"
    DoCmd.RunCommand acCmdRecordsGoToLast
    Fout:
    Exit Sub


    End Sub


    Jaap

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    These are command buttons? Can't say I've ever seen this. Have you turned off screen updating at some point?
    Maybe try Repaint method of that form.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49
    Quote Originally Posted by Micron View Post
    These are command buttons? Can't say I've ever seen this. Have you turned off screen updating at some point?
    Maybe try Repaint method of that form.
    Thank you, here the procedure.

    It looks to me repaint is working, is this possible?

    The button stays on until you use another button, that seems normal?

    Click image for larger version. 

Name:	Button.png 
Views:	8 
Size:	86.1 KB 
ID:	49843

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    By button being on I think you're referring to the hover colour. You can set that to the same as the back colour if the behaviour bothers you and that might eliminate it.
    If you don't specify a particular object name with syntax like that, the active object is what will be affected, which isn't necessarily what you expect.
    Why use mousedown event to open a form?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49
    Why use mousedown event to open a form?
    See Appendix, when hover over the button, hover color is light blue.Is mousedown not the right option to open a Form, what's better?

    Click image for larger version. 

Name:	Property Sheet.png 
Views:	7 
Size:	19.7 KB 
ID:	49844

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I would use just about anything else. The most likely would be
    - command button click event
    - combobox afterupdate event
    - listbox doubleclick

    I don't think you want to set Fore colour values to be the same as the other colours? Fore colour is for text. I guess OK if your button has no caption (text).

    EDIT - I removed a comment. If I could, I would have left it but used strike through on the font.
    Comment not relevant to mousedown when that event is for a command button.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    49
    Thank you very much.

    I've been informed enough, I think this topic has been solved.

    Regards,
    Jaap

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

Similar Threads

  1. Need to lose focus on a button on a sub form.
    By TenOc in forum Programming
    Replies: 1
    Last Post: 03-29-2019, 04:16 PM
  2. Replies: 5
    Last Post: 10-18-2016, 06:00 AM
  3. Replies: 3
    Last Post: 03-21-2016, 06:28 AM
  4. Replies: 2
    Last Post: 06-26-2012, 10:54 PM
  5. Replies: 11
    Last Post: 01-26-2012, 01:22 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