Private Sub cmdScrap_Click()
If MsgBox("Are you sure you wish to scrap this PC", vbYesNo, "Scrap PC?") = VbMsgBoxResult.vbYes Then
Dim scrapReason As String
scrapReason = InputBox("What is the reason for the scrap?", "Reason for scrap", "NEW PC")
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO tblScrapComputers ([ComputerId],[ComputerMakeID],[ComputerModelID],[SerialNumber]," _
& "[ServiceTag],[OperatingSystemID],[OSLicenseKey],[RAM],[Processor],[DatePurchased],[WarrantyPeriod]," _
& "[Notes],[date_scrapped],[reason_scrapped])" _
& "VALUES('" & [ComputerId] & "','" & [ComputerMakeID] & "','" & [ComputerModelID] & "','" & [SerialNumber] _
& "','" & [ServiceTag] & "','" & [OperatingSystemID] & "','" & [OSLicenseKey] & "','" & [RAM] _
& "','" & [Processor] & "','" & [DatePurchased] & "','" & [WarrantyPeriod] & "','" & [Notes] & "','" & Date & "','" & scrapReason & "')")
DoCmd.RunSQL ("DELETE FROM tblComputers WHERE [ComputerId] = '" & [ComputerId] & "'")
Me.Requery
DoCmd.SetWarnings True
Else
MsgBox ("no scrap")
End If
End Sub