Solved Write Conflict Issue (1 Viewer)

Oludare

New member
Local time
Today, 14:17
Joined
Jan 28, 2021
Messages
24
Dear All,

Could you please help. I ran the below code which ran okay but displays a pop up windows on Write Conflict issue. Please help.
Th UpdateReissueStgData was ran okay.

Private Sub cmdSave_Click()

On Error GoTo Save_Error

'Update reissue data and Set ReissueFlg in dbo.Ledger table.
UpdateReissueStgData
Me.Dirty = False
DoCmd.Close acForm, "frmInsertReissueRecord"

cmdSave_Click_Exit:
DoCmd.Close acForm, Me.Name
Exit Sub

Save_Error:
If Err.Number <> 2501 And Err.Number <> 0 And Err.Number <> 30014 Then
modMessageHelper.ShowErrorMessage Err.Description, "frmInsertReissueRecord.cmdSave_Click", Err.Number
Resume cmdSave_Click_Exit
Else
DoCmd.Close acForm, "frmInsertReissueRecord"
End If

Exit Sub

End Sub


Regards
Timi

Olutimi
 

Minty

AWF VIP
Local time
Today, 14:17
Joined
Jul 26, 2013
Messages
10,355
I'll bet that the UpdateReissueStgData refers to the same tables as the form is bound to.
So when you try and save the forms data using Me.DIrty = False it can't because you have already edited and saved the underlying data?
 

Oludare

New member
Local time
Today, 14:17
Joined
Jan 28, 2021
Messages
24
Thanks for the advice. I figured it out. I placed the Me.Dirty = False at the start of the form and it fixed it.
Many thanks for your efforts.
 

isladogs

MVP / VIP
Local time
Today, 14:17
Joined
Jan 14, 2017
Messages
18,186
I would suggest you just remove that line completely.
 

Users who are viewing this thread

Top Bottom