X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Can Backthemecolorindex Be Used With Backtint?, Access 2016    
post Mar 18 2017, 11:49 AM

Posts: 118
Joined: 18-June 06

BackTint is a control property that allows you to specify a percentage lighter or darker for a color.

The code below does not error out, and the form backcolor is set to Accent 1 (Index value of 4) but the color is not lightened by 50%.
I'm thinking that a form section is not a control, but I would like to apply the 50% lighter only to the detail section.
I know I can define another theme color such as Accent 2 to achieve the lighter color, but I would like to do this with code if
at all possible.

Can this be done?

Private Sub Command0_Click()
Dim o As Object
Dim i As Integer
For Each o In CurrentProject.AllForms
If o.Name <> Me.Name Then
DoCmd.OpenForm o.Name, acDesign, , , , acHidden
With Forms(o.Name)
.Detail.BackThemeColorIndex = 4
.Detail.BackTint = 50

End With
DoCmd.Close acForm, o.Name, acSaveYes
End If
Next o
End Sub

Go to the top of the page
post Mar 18 2017, 01:08 PM

Posts: 118
Joined: 18-June 06

I found the problem:

The property to be set is NOT BackTint, it is BackShade.

This code behaves correctly:

.Detail.BackThemeColorIndex = 4
.Detail.BackShade = 50
Go to the top of the page
post Mar 18 2017, 02:22 PM

UtterAccess VIP
Posts: 9,177
Joined: 6-December 03
From: Telegraph Hill


Nice! Thanks for sharing your solution.




David Marten
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    20th October 2017 - 04:46 PM