Hi peeps,
I have a combobox where i select a works order from, the results are displayed on a list box. The number of records in the list box is displayed in the text field. Once an individual has clicked on the combobox, depeding on the number of records on the listbox, when clicking on the command button a inout box should appear asking for the cylinder number they wish to deliver, chaging its status to delivered.
However when trying to do this the information is not editing the correct record. Below is my coding any help will be greatly appreciated.
Code:
For i = 1 To Me.Quantity 'depending on the textfirld showing the number of records
Stringy = InputBox("Please Enter/Scan The cylinder barcodes numbers you wish to Deliver")
StrSQl = "UPDATE tbl_Delupdate SET [D Status] = 'Delivered',[Date of D Status] = '" & Stringy1 & "' "
StrSQl = StrSQl & "WHERE [Works Order Number] = '" & [Works Order Number] & "' AND [Cylinder Barcode Label] = '" & Stringy & "' AND [Line Number] = '" & [Line Number] & "' AND [D Status] IS NULL OR [D Status] <> 'Delivered' "
db.Execute (StrSQl)
Stringy1 = InputBox("Transaction Date, (DD / MM / YY)", "Spec Gas System", Now())
MsgBox "Selected items have been marked as delivered for date " & Stringy1, vbInformation, "Items Changed Successfully"
Me.Refresh
End If
Next i
rs2.Close
db.Close
End Sub