Erreur d'ouvrir un forme

scaofild9 Messages postés 4 Date d'inscription jeudi 1 mai 2008 Statut Membre Dernière intervention 19 juin 2008 - 19 juin 2008 à 11:59
cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 - 19 juin 2008 à 14:40
salut a tous le monde , j'ais un probleme d'ouvrir une forme vb
il me donne ce message:
 (erreur d'execution '91')  variable objet ou variable table white non définé

voici le code :
Sub affichagegrille_location()


    grille_location.Clear
    grille_location.TextMatrix(0, 0) = "N°location"
    grille_location.TextMatrix(0, 1) = "codeclient"
    grille_location.TextMatrix(0, 2) = "idvehicule"
    grille_location.TextMatrix(0, 3) = "immatriculation"
    grille_location.TextMatrix(0, 4) = "typelocation"
    grille_location.TextMatrix(0, 5) = "datelocation"
    grille_location.TextMatrix(0, 6) = "dateretour"
    grille_location.TextMatrix(0, 7) = "prix"
   
    grille_location.ColWidth(0) = 1300
    grille_location.ColWidth(1) = 1300
    grille_location.ColWidth(2) = 1400
    grille_location.ColWidth(3) = 1400
    grille_location.ColWidth(4) = 1400
    grille_location.ColWidth(5) = 1400
    grille_location.ColWidth(6) = 1400
    grille_location.ColWidth(7) = 2000
    Set mabase = masession.OpenDatabase(App.Path & "\base.mdb")
    Set matable = mabase.OpenRecordset("select * from t_location")
    i = 1
    While Not matable.EOF
        grille_location.TextMatrix(i, 0) = matable![n°location]
        grille_location.TextMatrix(i, 1) = matable![codeclient]
        grille_location.TextMatrix(i, 2) = matable![idvehicule]
        grille_location.TextMatrix(i, 3) = matable![immatriculation]
        grille_location.TextMatrix(i, 4) = matable![typelocation]
        grille_location.TextMatrix(i, 5) = matable![datelocation]
        grille_location.TextMatrix(i, 6) = matable![dateretour]
        grille_location.TextMatrix(i, 7) = matable![prix]
        i = i + 1
        matable.MoveNext
    Wend
    matable.Close
End Sub

2 réponses

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
19 juin 2008 à 14:36
salut,

çà ne colle peut-être pas avec l'erreur mais...
au moment où tu remplies ton heauder, les 8 colonnes ne sont pas définies
et au moment où tu remplies tes lignes, elles ne sont pas non plus définies

voir .row(s) et .col(s)

++
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp
0
cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
19 juin 2008 à 14:40
Salut,

Rajoute dans ton projet la référence :
Microsoft ActivieX Data Objects 2.5 Library

Dim oRst As New ADODB.Recordset

oRst.Open "select * from t_location", TaConnexionActive, adOpenDynamic, adLockPessimistic

While Not oRst.Eof
        grille_location.TextMatrix(i, 0) = matable![n°location]
        grille_location.TextMatrix(i, 1) = matable![codeclient]
        grille_location.TextMatrix(i, 2) = matable![idvehicule]
        grille_location.TextMatrix(i, 3) = matable![immatriculation]
        grille_location.TextMatrix(i, 4) = matable![typelocation]
        grille_location.TextMatrix(i, 5) = matable![datelocation]
        grille_location.TextMatrix(i, 6) = matable![dateretour]
        grille_location.TextMatrix(i, 7) = matable![prix]
        oRst.MoveNext
 Wend

oRst.Close
Set oRst = Nothing

A+
Exploreur

 Linux a un noyau, Windows un pépin
0
Rejoignez-nous