VBA MSAccess - CheckBox on userform

Anonymous
2023-04-27T13:43:02+00:00

Dear All,

I have the below MSAccess Userform where I placed a CheckBox.

As you can see the its background is black: any way to make it with the same background color of the userform?

Thanks

Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-04-27T15:40:05+00:00

    Hi Lucausa

    I'm AnnaThomas and I'd happily help you with your question. In this Forum, we are Microsoft consumers just like yourself.

    Yes, you can change the background color of a CheckBox on an MS Access Userform to match the background color of the Userform. You can do this by setting the BackColor property of the CheckBox to the same value as the BackColor property of the Userform.

    For example, if your Userform is named UserForm1 and your CheckBox is named CheckBox1, you can use the following code to set the background color of the CheckBox to match the background color of the Userform:

    UserForm1.CheckBox1.BackColor = UserForm1.BackColor

    You can place this code in the UserForm_Initialize event so that it runs when the Userform is opened.

    I hope this helps ;-), let me know if this is contrary to what you need, I would still be helpful to answer more of your questions.

    Best Regards,

    AnnaThomas

    Give back to the community. Help the next person with this problem by indicating whether this answer solved your problem. Click Yes or No at the bottom.

    0 comments No comments
  2. Anonymous
    2023-04-27T20:41:05+00:00

    Thanks for your feedback!

    Initialize event is missing in VBA MSAccess so I have tried your code into Form_Load event but Backcolor seems to be missing:

    Any other suggestion?

    Thanks a lot!

    0 comments No comments
  3. Anonymous
    2023-04-27T20:57:35+00:00

    There are tutorials available that can help you with this. For example, here is a tutorial on YouTube that shows you how to change the color of a CheckBox in Microsoft Access by using Conditional Formatting and an extra text box.

    https://www.youtube.com/watch?v=9h8UNEozj0s

    Note: This is a non-Microsoft website. The page seems to provide accurate and reliable information. Beware of advertisements on the site that may advertise products frequently classified as PUPs (potentially unwanted products). Do thorough research on any product advertised on the site before downloading and installing it.

    You can also check out the Microsoft Learn page on the CheckBox.BorderColor property for more information on how to set the border color of a CheckBox control

    https://learn.microsoft.com/office/vba/api/Access.CheckBox.BorderColor

    You can also try this workaround

    Open the UserForm in Design View and add a Label control to the form. Resize and position the Label control so that it is directly behind the CheckBox control. Set the BackColor property of the Label control to match the BackColor property of the UserForm. You can do this by selecting the Label control, going to the Properties window, and setting the BackColor property to the desired value. Make sure that the Label control is behind the CheckBox control in the form’s tab order. You can do this by right-clicking on the form and selecting “Tab Order” from the context menu. Then, use the Tab Order dialog box to move the Label control behind the CheckBox control.

    0 comments No comments