Form buttons have unwanted white color surrounding them! (1 Viewer)

Mike Krailo

Active member
Local time
Today, 11:50
Joined
Mar 28, 2020
Messages
312
I'm using M365 version of Access. I have a simple form with some command buttons on it that have an unwanted white surrounding background color only when the form first loads. The screen shot provided shows what I am talking about. If I cycle from to design view and then back to form view, everything renders properly! I can't figure out what is causing this behavior. The buttons have a shadow effect on them and that appears to make the problem worse. If I take the shadow effect away, the buttons almost render properly. When I say almost, I mean that there is still small amount of white background showing in the four corners of the buttons if you look closely. The shape of the buttons are rounded corners. Again, if I go to design view and back to form view the problem goes away. Is this a bug in the current version of Access?

UPDATE: I think it may have something to do with the light blue rectangle that I have behind the buttons but the shadow effect is on the lowest layer. I tried to send the rectangle to the very back but shadows insist on being on the lowest level. :(

UPDATE#2: It's not the blue rectangle! It's the Tab Control. I took the tab control out of the equation and everything works fine. If you layer styled buttons on a rectangle over a tab control, that's when the render problem happens.

1602286087611.png


No shadow but still a small amount of white in the four corners.
1602286455903.png
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 08:50
Joined
Oct 29, 2018
Messages
16,612
Are you trying to colorize your tab pages?
 

Mike Krailo

Active member
Local time
Today, 11:50
Joined
Mar 28, 2020
Messages
312
I was trying to do that at first DBguy but as you can see the problem here is using a button with a shadow on a solid rectangle which is on top of a tab control. The shadow is trying to render on the tab control level when it should only be on the second level, the rectangle should be on the third level down, and the tab control background color should be on the fourth level down and the main form at the very lowest level.

If I take the tab control out of the equation, everything works fine.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:50
Joined
Oct 29, 2018
Messages
16,612
I was trying to do that at first DBguy but as you can see the problem here is using a button with a shadow on a solid rectangle which is on top of a tab control. The shadow is trying to render on the tab control level when it should only be on the second level, the rectangle should be on the third level down, and the tab control background color should be on the fourth level down and the main form at the very lowest level.

If I take the tab control out of the equation, everything works fine.
No, sorry, I was wondering why you even need a colored rectangle. Did you try coloring the tab itself? Just curious...

1602294266870.png
 
Last edited:

Mike Krailo

Active member
Local time
Today, 11:50
Joined
Mar 28, 2020
Messages
312
I don't need it, I am just pointing out a bug in Access. We should be able to put a rectangle on a tab control!
I think we should also be able to put a command button on the rectangle which we can, it just cannont have a shadow and needs to be square in shape to work without any tab control color bleeding through.
The only workaround that I have found is to place code in the button that launches the ReportForm that opens the form in design view first, then opens in form view.

Code:
Private Sub ReportBtn_Click()
   DoCmd.OpenForm "ReportForm2", 1
   DoCmd.OpenForm "ReportForm2"
End Sub

Please see the attached database file for an example of the problem and the workaround solution. I still think this is an Access bug.
 

Attachments

  • DemoFormButtons.accdb
    1.4 MB · Views: 158

theDBguy

I’m here to help
Staff member
Local time
Today, 08:50
Joined
Oct 29, 2018
Messages
16,612
Hi. Thanks for the clarification. I'll see if I can find anything about it and let you know.
 

Users who are viewing this thread

Top Bottom