Muhnamana
Muhnamana

Reputation: 1044

Access VBA Back Color Gradient For Label/Shape

I'm looking for a way in Access VBA to set the backcolor of a label, shaped, etc as a gradient. I'm currently applying solid colors but was hoping there is a way to accomplish this via a gradient.

Here is how I'm currently applying a back color in Access:

    Label2.BackColor = RGB(119, 49, 65)

Here was the code I was using in Excel, to fill a cell as a gradient, worked well. However, I'm not sure exactly how Access VBA would work. Suggestions to point me in the right direction?

    Range("D14").Select
    With Selection.Interior
    .Pattern = xlPatternLinearGradient
    .Gradient.Degree = 0
    .Gradient.ColorStops.Clear
    End With
    With Selection.Interior.Gradient.ColorStops.Add(0)
    .Color = 2786997
    .TintAndShade = 0
    End With
    With Selection.Interior.Gradient.ColorStops.Add(1)
    .Color = 1447704
    .TintAndShade = 0
    End With

Upvotes: 1

Views: 4502

Answers (1)

Brad
Brad

Reputation: 12253

A Label cannot have a gradient background.

enter image description here

If you want to set the gradient on a button you can do that similar to before.

button.Gradient = 12

Upvotes: 1

Related Questions