Message d'erreur

apdf1

XLDnaute Impliqué
Re,

Voilà dans ma listBox quand je passe mon curseur sur les items j'ai le nom et le N° de factures qui s'affiche dans le label "Lien" se trouvant dessous la listbox.

J'ai un message d'erreur qui s'affiche

"Impossible de lire la propriété list index de table de propriété non valide"



Code:
Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  ligne = Int(Y / (ListBox1.Font.Size * 1.2))
  If Y > 0.2 And Y <= ListBox1.Height And ligne < Me.ListBox1.ListCount Then
    Me.Curseur.Visible = True
    Me.Lien.Visible = True
   
    Me.Curseur.Top = ligne * ListBox1.Font.Size * 1.2 + Me.ListBox1.Top
    [COLOR="red"][B]Me.Lien.Caption = ListBox1.List(ligne + Me.ListBox1.TopIndex, 2)[/B] [/COLOR]    Aff_C = "  "
    Aff_C = Aff_C & ListBox1.List(ligne + Me.ListBox1.TopIndex, 2)
    Aff_C = Aff_C & "  de la Société  "
    Aff_C = Aff_C & ListBox1.List(ligne + Me.ListBox1.TopIndex, 0)
    Me.Lien.Caption = Aff_C
    Me.ListBox1.ListIndex = ligne + Me.ListBox1.TopIndex
  Else
    Me.Lien.Visible = False
   
  
  End If
End Sub

Je joint mon fichier qui seras cetainement plus parlant

Merci d'avance

Max
 

Pièces jointes

  • ListboxSupprimerModifierBD2.xlsm
    23.7 KB · Affichages: 49
  • ListboxSupprimerModifierBD2.xlsm
    23.7 KB · Affichages: 51
  • ListboxSupprimerModifierBD2.xlsm
    23.7 KB · Affichages: 52

pierrejean

XLDnaute Barbatruc
Re : Message d'erreur

RE

Merci job :) :)

Veux-tu tester cette version ?
 

Pièces jointes

  • ListboxSupprimerModifierBD2.xlsm
    30.3 KB · Affichages: 37
  • ListboxSupprimerModifierBD2.xlsm
    30.3 KB · Affichages: 38
  • ListboxSupprimerModifierBD2.xlsm
    30.3 KB · Affichages: 40

Discussions similaires

Réponses
17
Affichages
922