Senin, 20 April 2020

Re: [MSAccessProfessionals] Change Forecolor and backcolor

If I understand the code correctly sets the control format properties accept those controls that have Conditional Formatting set. If this is the case, you may need to use the code to unset conditional formatting and then setting it back on as needed.

Regards,
Duane


From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of domcoz <domcoz@gmail.com>
Sent: Monday, April 20, 2020 3:47 AM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: [MSAccessProfessionals] Change Forecolor and backcolor
 
Hi,

Private Sub Corpo_Format(Cancel As Integer, FormatCount As Integer)
    
    Dim ctlVar As control
    For Each ctlVar In Me.Controls
            Select Case ctlVar.ControlType
                Case acTextBox
                    ctlVar.ForeColor = RGB(255, 255, 255)
                    ctlVar.BackColor = RGB(255, 255, 255)
            End Select
    Next
    
End Sub

I have to change the forecolor and backcolor properties in certain conditions, everything works well except for fields where there is a conditional format.
 
do you have any idea why?
 
Thank you very much
Domenico

Tidak ada komentar:

Posting Komentar