Color around command button that gets focus when form opens

Posted on 2014-11-12
Last Modified: 2014-11-14
On a form I have a command button.  I have that command button getting the focus when the form opens with:

Private Sub Form_Open(Cancel As Integer)


End Sub

Open in new window

But then the command button gets a blue color around it because it has the focus,  Is there a way to change this so there is no color around it?
Question by:SteveL13
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40438867
You possibility could replace this button with a label and make it look like a button.

You can use its click event and press event feature could be added to it all minus that blue line.

Such a label will not get focus period.
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 40440165
Just curious: Why would you NOT want the user to know where the focus is on the form? That is basic Windows user conventions, and in general it's not a good idea to go against those sort of ingrained paradigms. Users are accustomed to looking for an object that has the focus ...

That said: You might be able to include a veeeeery small button on the form, and give that the focus when the form starts. Users would very likely not see it (and you could perhaps hide it behind something else) - but that still begs the question of why you don't want the user to see it ...

Author Comment

ID: 40440184
The form is really just a launchpad with command buttons that execute other forms or reports.  By design I have the exit command button being the focus but then the blue "halo" around it.

I will try the small button under another object.
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

LVL 34

Accepted Solution

Mike Eghtebas earned 250 total points
ID: 40440201
Now that your concern is known. Have a textbox with width = 0 and intedex tab of zero. The same effect as a small button but unlike a button, it will now show a helo. Samll button, no matter how small will still get helo.

LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40440288
Thank you but this should be shared with Scott for asking the essential question I failed to ask. If you could use Request Attention to reopen and the question to share the points.



Author Comment

ID: 40440369
I have requested attention.
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40440411
Thank you very much.

Author Closing Comment

ID: 40442438
Awarded to both experts.  Thank you to both of you.

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question