1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Private Sub Report_Load()
Dim pProp As Property
Dim cControl As Control
Dim cControls As Controls
Dim strControl As String
Dim i As Integer
Dim iProp As Integer
Dim strToFind As String
'Je cherche à trouver 'SommeDeSOLDE' quelque part dans l'état
strToFind = "SommeDeSOLDE"
For Each cControl In Controls
strControl = cControl.Name
If InStr(1, strControl, strToFind) > 0 Then
Debug.Print strControl, " Trouvé !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
End If
iProp = Reports![MonReport].Properties.Count
Debug.Print strControl, "contient " & iProp & " properties à examiner."
For i = 0 To iProp - 1
If i <> 152 Then
'Je ne sais pas pourquoi mais la propriété 152 donne une erreur.
If InStr(1, Reports![MonReport].Properties(i).Name, strToFind) > 0 Then
Debug.Print strControl, i, Reports![MonReport].Properties(i).Name, Reports![MonReport].Properties(i).Value
End If
If InStr(1, Reports![MonReport].Properties(i).Value, strToFind) > 0 Then
Debug.Print i, Reports![MonReport].Properties(i).Name, Reports![MonReport].Properties(i).Value
End If
End If
Next i
Next
End Sub |
Partager