Link to home
Start Free TrialLog in
Avatar of Tracy
TracyFlag for United States of America

asked on

Access Form - Button Format Issue

I have a form in access and I'm copying the 'Clear Header' button in the attached screenshot to use as a template for other buttons.  It looks exactly the same when I display the form, but as soon as I compact and repair, it changes slightly adding the extra white spots in the four corners (shown in screenshot).  How can I prevent this from happening?  It had worked before for a few buttons, but now it is always displaying the white corners.  I also tried creating a button from scratch again and it does the same thing.
Capture.PNG
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

there is a property called Use Theme (Format tab of Property Sheet) that is Yes or No

there is also a Shape property you can change with code
https://msdn.microsoft.com/en-us/library/office/ff197644.aspx 

call this when form you want to change is active and in design view:
Sub ActiveForm_Design_ChangeCommandButtonShape(Optional pSetting As Long = 1)
'161213 strive4peace
'  Change Shape of command Buttons for ActiveForm
'  Form must be in Design View for changes to be saved

' -----  pSetting:-----
'0  Rectangle
'1  Rounded Rectangle (Default)
'2  Snip Single Corner Rectangle
'3  Snip Same Side Corner Rectangle
'4  Snip Diagonal Corner Rectangle
'5  Snip and Round Single Corner Rectangle
'6  Round Single Corner Rectangle
'7  Round Same Side Corner Rectangle
'8  Round Diagonal Corner Rectangle
'9  Oval

   Dim ctl As Control
   Dim iCount As Integer
   iCount = 0
   For Each ctl In Screen.ActiveForm.Controls
      With ctl
         If .ControlType = acCommandButton Then
            If ctl.Shape <> pSetting Then
               ctl.Shape = pSetting
               iCount = iCount + 1
            End If
         End If
      End With
   Next ctl
   
   MsgBox "Done changing shape for " & iCount & " command buttons", , "Done"
End Sub

Open in new window

Avatar of Tracy

ASKER

Thanks for this.  It is set to Rounded Rectangle already and it still shows the extra white spaces in the corners.

Any ideas on how to change this?
Following Crystal's comment the shapes look like this
User generated imageCaptured from ThemeMyDatabase Selector.
The options are on the Format Tab but  the numbers are not shown.User generated image
Avatar of Tracy

ASKER

Yeah, I saw this.  The middle one in the top row is selected, this is the shape I want.  However, as shown in the screenshot, there are still white spaces showing up on the four corners.  When I add a new command button, the same thing happens.

How can I set It so that it has rounded corners (1), but no extra white spaces, like the other buttons in the screenshot.
Which version are you using?I have tried 2010 and 2016 and don't have the dots. Tried an assortment of settings but don't get the dots. If you can you copy an offending button to a new db  I will take a look.
you're welcome -- I was quite happy to find that out myself ;)

what is the Use Theme setting?

Does the image perhaps have transparent corners? or corners set to white?  Is the image from a file or from resources (if so, how is it stored -- as a BMP without transparency capability?)

if it is not the image itself, or command button properties ...

what is the Picture Property Storage Format? (File, Options, Current Database)?

what Theme is Windows using? This can also impact Access
Avatar of Tracy

ASKER

Here is a part of the form.  If you go to design view, then form view it works fine.  But as soon as you Compact and Repair, the white spaces appear.  It's the 'Add Manual GCARS' button.

Any help is appreciated.
TestShape.zip
Avatar of Tracy

ASKER

Also, I'm using Access 2010.
Thanks for that. I have had a quick look and it's very strange. I tried the SaveAsText and LoadFromText method and that did not resolve the problem. I also tried adding an image then removing it, no luck either.
I will look further in the morning.
Avatar of Tracy

ASKER

Thanks for taking a look.  I am stumped on this one, I've never seen this happen before.
ASKER CERTIFIED SOLUTION
Avatar of Peter Cole
Peter Cole
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tracy

ASKER

Wow, that is pretty amazing.  Doing those steps did indeed fix the issue.  Thank you so much for looking into this!

I added a second box in the sample I uploaded thinking that maybe it has something to do with the position, sending to back/front, but that didn't make any difference.
Avatar of Tracy

ASKER

Thank you for taking the time to research this, I really appreciate all your effort.