alias666
Messages postés308Date d'inscriptionmardi 1 juin 2004StatutMembreDernière intervention23 mars 2010
-
24 nov. 2004 à 15:51
alias666
Messages postés308Date d'inscriptionmardi 1 juin 2004StatutMembreDernière intervention23 mars 2010
-
24 nov. 2004 à 17:32
Lut tout le monde
J'ai une requête dans laquelle je voudrais récupéré des infos. Ces infos étant dans la table TableImport.
Private Sub btnRapport_Click()
Dim Rst As Recordset, Rst2 As Recordset
Screen.MousePointer = vbHourglass
If cboProfil.ListIndex < 0 Then
MsgBox "Veuillez sélectionner un profil", vbInformation, "Information"
cboProfil.SetFocus
Else
If cboPc.ListIndex < 0 Then
MsgBox "Veuillez sélectionner un pc", vbInformation, "Information"
cboPc.SetFocus
Else
Db.Execute "DELETE * from Impression", dbOpenDynaset Set Rst Db.OpenRecordset("select * from detailprofil where Numprofil" & cboProfil.ItemData(cboProfil.ListIndex), dbOpenSnapshot)
While Not Rst.EOF Set Rst2 Db.OpenRecordset("select * from tableimport where libellé'" & cboPc.List(cboPc.ListIndex) & "'" And Page = Rst!Page And Group = Rst!Group And Item = Rst!Item, dbOpenDynaset)
While Not Rst2.EOF
Rst2.MoveNext
Wend
Rst2.Close
Wend
Rst.Close
End If
End If
Screen.MousePointer = vbDefault
End Sub
Le prob c'est qu'il me dis que "Page" dans le RST2 est une variable non définie alors que c'est un champs dans La table "TableImport"
Ricks27
Messages postés79Date d'inscriptionmardi 4 juin 2002StatutMembreDernière intervention29 juillet 2005 24 nov. 2004 à 17:30
Avant : Set Rst2 Db.OpenRecordset("select * from tableimport where libellé'" & cboPc.List(cboPc.ListIndex) & "'" And Page = Rst!Page And Group = Rst!Group And Item = Rst!Item, dbOpenDynaset)
Après :
Set Rst2 =Db.OpenRecordset("select * from tableimport where libellé ='" & cboPc.List(cboPc.ListIndex) & "' And Page='" & Rst!Page & "' And Group ='" & Rst!Group & "' And Item='" & Rst!Item &"'",dbopendynaset)
jrivet
Messages postés7392Date d'inscriptionmercredi 23 avril 2003StatutMembreDernière intervention 6 avril 201260 24 nov. 2004 à 16:51
Salut,
Ne faudrait il pas essayer de changer :
Set Rst2 Db.OpenRecordset("select * from tableimport where libellé'" & cboPc.List(cboPc.ListIndex) & "'" And Page = Rst!Page And Group = Rst!Group And Item = Rst!Item, dbOpenDynaset)
Par
Set Rst2 Db.OpenRecordset("select * from tableimport where libellé'" & cboPc.List(cboPc.ListIndex) & "'" And Page = '" & Rst!Page & "' And Group = '" & Rst!Group & "' And Item = '" & Rst!Item & "'", dbOpenDynaset)
@+
Julien
-----------------------------------------------------------
:big) Essai ca sinon on trouvera autre chose ;)
-----------------------------------------------------------