Buonasera, ho creato la seguente funzione per per formattare dei campi di una maschera:
Public Function format_campo(ctrl As Access.control) As Boolean
With ctrl
If Len(.Value & vbNullString) = 0 Then
    Select Case format_campo
        Case format_campo = False
                        .SpecialEffect = 0
                        .BorderWidth = 1
                        .BorderColor = rosso
                        .Value = "!"
                        .TextAlign = 1
                        .ForeColor = rosso
        Case format_campo = True
                        .SpecialEffect = 2
                        .BorderWidth = 1
                        .BorderColor = g_chiaro
                        .Value = vbNullString
                        .TextAlign = 1
                        .ForeColor = vbBlack
    End Select
End If
End With
Set ctrl = Nothing
End Function
la funzione la utilizzo poi nel seguente modo:
If Len(Me.txtente_rich & vbNullString) = 0 Then format_campo (Me.txtente_rich) = False
mi restituisce un errore "La chiamata di funzione a sinistra dell'assegnazione deve restituire Variant o Object.
Dove sbaglio?