Question : Transfert in Microsoft access db

Hello all,

i need to send the value from a textbox ("txtQté.text") in a specific column called Quantité_distribuée.

But if there already a value in it, it will add the new value to the existant value.

For ex: if i had 10 already as a value in my access db, and in my textbox, i have 20, then it will put 30 in my access db.

But to filter the good line, i need 2 creteria:

 
Dim sSQL3 As String
Dim oRST3 As ADODB.Recordset
Set oRST3 = New ADODB.Recordset
Dim oConnect3 As ADODB.Connection
Set oConnect3 = New ADODB.Connection


sSQL3 _
        = " SELECT [Période],[Description_du_produit],[Quantité_distribuée]" _
        & " FROM [Inventaire]" _
        & " WHERE Période = '" & ComDateDisponible.Text & "'" _
        & "   AND Description_du_produit = '" & Des_prod.Text & "'"


Période from "ComDateDisponible.Text"   and    Description_du_produit  from "Des_prod.Text".

How can i do this please?

Here is what i have for know


Thanks
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:
Dim sSQL3 As String
Dim oRST3 As ADODB.Recordset
Set oRST3 = New ADODB.Recordset
Dim oConnect3 As ADODB.Connection
Set oConnect3 = New ADODB.Connection


sSQL3 _
        = " SELECT [Période],[Description_du_produit],[Quantité_distribuée]" _
        & " FROM [Inventaire]" _
        & " WHERE Période = '" & ComDateDisponible.Text & "'" _
        & "   AND Description_du_produit = '" & Des_prod.Text & "'"

oConnect3.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & Form4.txtBaseDe.Text & ";"

oRST3.Open sSQL3, oConnect3

If Des_prod > "" Then
oRST3.Filter = "Quantité_distribuée"

   
     

        
    End If

Answer : Transfert in Microsoft access db

Dim sSQL3 As String
Dim oRST3 As ADODB.Recordset
Set oRST3 = New ADODB.Recordset
Dim oConnect3 As ADODB.Connection
Set oConnect3 = New ADODB.Connection


sSQL3 _
        = " UPDATE [Quantité_distribuée]" _
        & " FROM [Inventaire]" _
        & " WHERE Période = '" & ComDateDisponible.Text & "'" _
        & "   AND Description_du_produit = '" & Des_prod.Text & "'"

oConnect3.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & Form4.txtBaseDe.Text & ";"
oConnect3.execute sSQL3
Random Solutions  
 
programming4us programming4us