I have a main form (frmIncmgInspectLog) that lets the user select a purchase order (PO) from a dropdown list. After that field is updated with a PO value, that opens another form that contains a list box with information about hardware parts ordered by the selected PO. The user selects a part and the OnClick event triggers an update event that will update some fields back on the main form.
I don't see the update immediately on the main form. When I click to the next record I see a message about a Write Conflict (see attachment).
1) If I have the main form open - can I not write to the current record?
2) How can I bypass or surpress the Write Conflict message?
Here is my code from the list box on the form that is called by the main form
Private Sub List0_Click()
Dim strSQL As String
Dim PartNum As String
Dim Nomen As String
Dim Qty As Integer
Dim Due As Date
Dim key As Integer
PartNum = Me.PartNumber
Nomen = Me.Nomenclature
Qty = Me.Quantity
Due = Me.DueDate
'Update the Incmg Inspection Log with the selected information
strSQL = "UPDATE tblINCOMING_INSPECT_LOG SET PartNumber = '" & PartNum & "', Nomenclature = '" & Nomen & "', QtyOrdered = " & Qty & ", DateShpDue = # " & Due & " # WHERE IncmgInspectLogID = " & updKey & " ;"
MsgBox "SQL: " & strSQL 'Debug: check my statement
CurrentDb.Execute strSQL, dbFailOnError
MsgBox "Table has been updated!" 'Debug
DoCmd.Close
End Sub
Thanks!
I don't see the update immediately on the main form. When I click to the next record I see a message about a Write Conflict (see attachment).
1) If I have the main form open - can I not write to the current record?
2) How can I bypass or surpress the Write Conflict message?
Here is my code from the list box on the form that is called by the main form
Private Sub List0_Click()
Dim strSQL As String
Dim PartNum As String
Dim Nomen As String
Dim Qty As Integer
Dim Due As Date
Dim key As Integer
PartNum = Me.PartNumber
Nomen = Me.Nomenclature
Qty = Me.Quantity
Due = Me.DueDate
'Update the Incmg Inspection Log with the selected information
strSQL = "UPDATE tblINCOMING_INSPECT_LOG SET PartNumber = '" & PartNum & "', Nomenclature = '" & Nomen & "', QtyOrdered = " & Qty & ", DateShpDue = # " & Due & " # WHERE IncmgInspectLogID = " & updKey & " ;"
MsgBox "SQL: " & strSQL 'Debug: check my statement
CurrentDb.Execute strSQL, dbFailOnError
MsgBox "Table has been updated!" 'Debug
DoCmd.Close
End Sub
Thanks!