I have a form that is bound to a table and also a subform that is also bound to a table. On the Subform I have a Plus and Minus buttons that sort of work at as a tally chart. Every time you click the plus button it adds 1 to the quantity textbox and vice versa for the subtract button. What currently happens is when the Plus button is clicked the follwing runs:
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
RS.Open "SELECT * from tblQuantity", Application.CurrentProject.Connection, adOpenStatic, adLockOptimistic
RS.AddNew
RS!Barcode = cmbProductName.Column(2)
RS!EXOrderID = Forms![tblorders].[ID]
RS!TransID = TransID
RS!TransDate = Date
RS!QuantitySold = 1
RS!QuantityBought = 0
RS.Update
RS.Close
Set RS = Nothing
What this does is create a record on the tblQuantity table, but it creates a new record each time the plus button is click.
So i.e.
I click the plus button 10 times and it creates 10 records
What I require is, it creates 1 record and just puts 10 in the QuantitySold column in the tblQuantity table. This will make the table easier to read.
I have attached the Database
Thanks
Danian
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
RS.Open "SELECT * from tblQuantity", Application.CurrentProject.Connection, adOpenStatic, adLockOptimistic
RS.AddNew
RS!Barcode = cmbProductName.Column(2)
RS!EXOrderID = Forms![tblorders].[ID]
RS!TransID = TransID
RS!TransDate = Date
RS!QuantitySold = 1
RS!QuantityBought = 0
RS.Update
RS.Close
Set RS = Nothing
What this does is create a record on the tblQuantity table, but it creates a new record each time the plus button is click.
So i.e.
I click the plus button 10 times and it creates 10 records
What I require is, it creates 1 record and just puts 10 in the QuantitySold column in the tblQuantity table. This will make the table easier to read.
I have attached the Database
Thanks
Danian