I'm having trouble with adding multiple records to a table in access. The fields are number (data type) and I can't change them due to the relationships needed for a query used to calulate amounts. Here is the cade I have currently maybe someone could help me out with this as I'm fairly new to VB. I know that this code will work with Text (data type) fields. Please help here is the code
Private Sub Ctl1_kortek_kit_Click()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM [Inventory Transactions]", dbOpenDynaset) ' Dynaset to enable UPdating
If rs.EOF And rs.BOF Then
MsgBox "File is Empty"
Else
rs.AddNew
rs("Part") = "kortek kit"
rs("Transaction Type") = "addition"
rs("Technician") = "auto button add"
rs("quantity") = "1"
rs.Update
rs.AddNew
rs("part") = "80-0128-105"
rs("transaction type") = "removal"
rs("Technician") = "auto button add"
rs("quantity") = "1"
rs.Update
rs.AddNew
rs("part") = "80-0148-105"
rs("transaction type") = "removal"
rs("Technician") = "auto button add"
rs("quantity") = "2"
rs.Update
rs.AddNew
rs("part") = "80-0109-105"
rs("transaction type") = "removal"
rs("Technician") = "auto button add"
rs("quantity") = "2"
rs.Update
rs.AddNew
rs("part") = "80-0123-105"
rs("transaction type") = "removal"
rs("Technician") = "auto button add"
rs("quantity") = "1"
rs.Update
rs.AddNew
rs("part") = "62-0161-00"
rs("transaction type") = "removal"
rs("Technician") = "auto button add"
rs("quantity") = "1"
rs.Update
MsgBox "1 kit added to Stock"
End If
End Sub
Thanks