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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Dim rsfact_four As ADODB.Recordset
Dim rsligne_fact_four As ADODB.Recordset
Dim cn As ADODB.Connection
Dim i As Integer
g.FixedRows = 1
g.Rows = 2
Set cn = New ADODB.Connection
cn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Documents and Settings\Administrateur.INTERNET\Bureau\ma_base.MDB;"
cn.Open
Set rsligne_fact_four = New ADODB.Recordset
Call rsligne_fact_four.Open("Select * from ligne_facture_four where code_article='" & Combo1.Text & "'", cn, 1, 2)
If rsligne_fact_four.RecordCount = 0 Then
MsgBox "pas de facture contenant cet article!!"
Exit Sub
Else
rsligne_fact_four.MoveFirst
While rsligne_fact_four.EOF = False
Set rsfact_four = New ADODB.Recordset
Call rsfact_four.Open(" select * from Facture_four where Facture_four.N°facture= " & rsligne_fact_four("code_article"), cn, 1, 2)
'********************* l'erreur ce produit ICI **************
rsfact_four.MoveFirst
'**********************************************************
While rsfact_four.EOF = False
With g
i = .Rows - 1
.Rows = .Rows + 1
.TextMatrix(i, 0) = rsligne_fact_four.Fields(0)
.TextMatrix(i, 1) = rsligne_fact_four.Fields(1)
.TextMatrix(i, 2) = rsfact_four.Fields(1)
.TextMatrix(i, 3) = rsfact_four.Fields(2)
.TextMatrix(i, 4) = rsligne_fact_four.Fields(4)
.TextMatrix(i, 5) = rsligne_fact_four.Fields(5)
End With
rsfact_four.MoveNext
Wend
rsligne_fact_four.MoveNext
Wend
g.Refresh
cn.Close
End If
End Sub |
Partager