Need to dynamically change formats,

sportsguy

Finance wiz, Access hack
Local time
Today, 18:56
Joined
Dec 28, 2004
Messages
363
I need to change the control format property from standard to percent,
and 0 decimals with standard to 1 decimal place with percent. .

its not working, and I know where, but I can't find the proper coding.
any help is appreciated, thanks

sportsguy

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim ctlDetail as Control

If Me.RevenueType = "Booked Est SMP" Then
    ' Change Font to Percent for all Controls in Section
    For Each ctlDetail In Me.Detail.Controls
        With ctlDetail
            .Format = Percent      
            .Decimal = 1
        End With
    Next
Else
    ' Change Font to Normal for all controls in section
    For Each ctlDetail In Me.Detail.Controls
        With ctlDetail
            .Format = 5
            .DecimalPlaces = 0
        End With
    Next
End If

End Sub
 
posted before I found the answer, end of day, tired,

Code:
If Me.RevenueType = "Booked Est SMP" Then
    ' Change Font to Bold for all Controls in Section
    
    For Each ctlDetail In Me.Detail.Controls
       If Left(ctlDetail.Name, 4) = "Mnth" Then
            With ctlDetail
                .Format = "Percent"
                .DecimalPlaces = 1
            End With
        End If
    Next
Else
    ' Change Font to Normal for all controls in section
    For Each ctlDetail In Me.Detail.Controls
       If Left(ctlDetail.Name, 4) = "Mnth" Then
            With ctlDetail
                .Format = "Standard"
                .DecimalPlaces = 0
            End With
        End If
    Next
End If
 

Users who are viewing this thread

Back
Top Bottom