Je ne comprend pas !
j'ai insérer le code de Vodiem
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
| Private Sub Form_Load()
LargCol = Array(0, 700, 3000)
If Form.RecordSource <> "" Then
Set monRs = CurrentDb.OpenRecordset(Form.RecordSource)
Dim itmX As ListItem
For Each nf In monRs.Fields 'chargement des désignations de colonnes
ListView1.ColumnHeaders.Add , , nf.Name
Next nf
For i = 1 To UBound(LargCol) 'fixation des largeurs de colonne
ListView1.ColumnHeaders(i).Width = LargCol(i)
Next i
While Not monRs.EOF 'chargement des enregistrements
For i = 1 To (monRs.Fields.Count - 1)
Set itmX = ListView1.ListItems.Add
itmX.Icon = monRs.Fields(0).Value '1er champ contient l'indice pour l'icone de l'imageliste
itmX.SmallIcon = monRs.Fields(0).Value '1er champ contient l'indice pour l'icone de l'imageliste
itmX.SubItems(i) = CStr(monRs.Fields(i))
Next i
monRs.MoveNext
Wend
End If
End Sub |
Non seulement il me met une erreur sur :
ListView1.ColumnHeaders.Add , , nf.Name
"Propriété ou méthode non gérée par cet objet"
Et il me met toujours "l'opération sur l'objet OLE à échoué !" quand je load mon form !
Partager