98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Buttons on a form
Buttons on a form
Resolved · Low Priority · Version 2010
Stuart has attended:
Access Intermediate course
Access Advanced course
Access VBA course
Buttons on a form
Hi,
I have a form with a few buttons and whilst tabbing through them it's very difficult to see which button I'm on. Is there a way to highlight/change the colour of the button in the same way a button can change colour when hovering over it with the mouse?
RE: Buttons on a form
Hello Stuart,
Hope you enjoyed your Microsoft Access courses with Best STL.
Thank you for your question regarding changing the colour of a button when tabbing onto it.
The following code does this for a command button named cmdCloseForm2 containing text items as opposed to images. It works!
First select the command button and from the Event section of the Property sheet click the ... in the On Got Focus row and use the code below. You must amend the part 'cmdCloseForm2' to whatever you have named your button. Colour choices are also up to you.
Private Sub cmdCloseForm2_GotFocus()
cmdCloseForm2.FontSize = 9
cmdCloseForm2.FontBold = True
cmdCloseForm2.ForeColor = vbRed
cmdCloseForm2.BackColor = vbYellow
End Sub
Private Sub cmdCloseForm2_LostFocus()
cmdCloseForm2.FontSize = 10
cmdCloseForm2.FontBold = False
cmdCloseForm2.ForeColor = vbBlack
cmdCloseForm2.BackColor = vbWhite
End Sub
Access will automatically place the second bit of code into the Lost Focus row in the Property sheet.
Give this a test and let me know how it works for you.
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Rodney
Microsoft Office Specialist Trainer
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Design View in Relationship windowYour in the Relationship window and changes are required to be made to a Table's design. |