Dim sSQL2 As String
Dim oRST2 As ADODB.Recordset
Dim oConnect2 As ADODB.Connection
Set oRST2 = New ADODB.Recordset
Set oConnect2 = New ADODB.Connection
sSQL2 _
= " SELECT Sum([Quantité_assignée])" _
& " FROM [Distribution employé]" _
& " WHERE Période = '" & ComDateDisponible.Text & "'" _
& " AND Description_du_produit = '" & Des_prod.Text & "'"
oConnect2.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & Form4.txtBaseDe.Text & ";"
oRST2.Open sSQL2, oConnect2
MsgBox oRST2.Fields(0).Value
|