I have form, with a number of orders on there, i wanted to be able to give the user the option to select all the orders and update each record, however what happens is the user can select all the records by using a checkbox, then they click on a command button, when they click on that command button it only edits the first records. how do i get it tp update all of them.
Dim db As DAO.Database
Dim String2 As Integer
Dim i As Integer
Dim rs As DAO.Recordset
Dim StrSQL As String
Set db = CurrentDb
Set rs = db.OpenRecordset("kell")
For i = 1 To Me.Quantity
Stringy2 = InputBox("The Cylinder/Cylinders Will Be with the driver
from The Specified Date Below:-", "Spec Gas 2006, (DD / MM / YY)", Me!Text68 & "")
If StrPtr(Stringy2) <> 0 Then
rs.AddNew
rs![Line Number] = Me![Line Number]
rs![Time of Transaction] = Me![Transaction Date]
rs![Cylinder Barcode Label] = Me![Cylinder Barcode Label]
rs![Cylinder Number] = Me![Cylinder Number]
rs![ProdNo] = Me![ProdNo]
rs![Status] = Me![Status]
rs![AberdeenWONumber] = Me![AberdeenWONumber]
rs![Works Order Number] = Me![Works Order Number]
rs![CustNo] = Me![CustNo]
rs![Customer Order Number] = Me![Customer Order Number]
rs![Date of Transaction] = Stringy2
rs![User name] = Me![User name]
rs![Employee ID] = Me![Empoyee ID]
rs![A Number] = Me![A Number]
rs![New Status] = "With Driver"
rs![Date of Transaction] = Me!Text68
Me.Text71 = "With Driver"
Me.Text71.ForeColor = vbRed
Me.Text74 = Me.Text68
rs.Update
MsgBox "The cylinder is now with the driver", vbInformation, "Returned Successfully"
End if
Next i
rs.Close
db.Close
End Sub
Dim db As DAO.Database
Dim String2 As Integer
Dim i As Integer
Dim rs As DAO.Recordset
Dim StrSQL As String
Set db = CurrentDb
Set rs = db.OpenRecordset("kell")
For i = 1 To Me.Quantity
Stringy2 = InputBox("The Cylinder/Cylinders Will Be with the driver
from The Specified Date Below:-", "Spec Gas 2006, (DD / MM / YY)", Me!Text68 & "")
If StrPtr(Stringy2) <> 0 Then
rs.AddNew
rs![Line Number] = Me![Line Number]
rs![Time of Transaction] = Me![Transaction Date]
rs![Cylinder Barcode Label] = Me![Cylinder Barcode Label]
rs![Cylinder Number] = Me![Cylinder Number]
rs![ProdNo] = Me![ProdNo]
rs![Status] = Me![Status]
rs![AberdeenWONumber] = Me![AberdeenWONumber]
rs![Works Order Number] = Me![Works Order Number]
rs![CustNo] = Me![CustNo]
rs![Customer Order Number] = Me![Customer Order Number]
rs![Date of Transaction] = Stringy2
rs![User name] = Me![User name]
rs![Employee ID] = Me![Empoyee ID]
rs![A Number] = Me![A Number]
rs![New Status] = "With Driver"
rs![Date of Transaction] = Me!Text68
Me.Text71 = "With Driver"
Me.Text71.ForeColor = vbRed
Me.Text74 = Me.Text68
rs.Update
MsgBox "The cylinder is now with the driver", vbInformation, "Returned Successfully"
End if
Next i
rs.Close
db.Close
End Sub