Selasa, 21 April 2020

Re: [MSAccessProfessionals] Change Forecolor and backcolor

hi Domenico,

you may want to test:

If ctlVar.FormatConditions.count >0 Then

unless there is a specific reason you only want to change it if it has exactly 1

kind regards,
crystal

msaccessgurus.com


On 4/21/2020 1:39 AM, domcoz wrote:
Thanks Duane,

I modified the code like this:

    Dim ctlVar As control
    For Each ctlVar In Me.Controls
        If ctlVar.visible = True Then
            Select Case ctlVar.ControlType
                Case acTextBox
                    On Error Resume Next
                    If ctlVar.FormatConditions.count = 1 Then
                        ctlVar.FormatConditions.Delete
                    End If
                    ctlVar.ForeColor = RGB(255, 255, 255)
                    ctlVar.BackColor = RGB(255, 255, 255)
            End Select
        End If
    Next

I'll explain: I have a complex report and my boss asked me to be able to print it without values. and then I thought about this trick.

Thanks a lot,.

Domenico

Tidak ada komentar:

Posting Komentar