Looks like a few folks have issues with the Write Conflict popup.
I'm going to join that group today.
I have a form that is open from another form. (F_Project has button to open F_Contract. See below)
When a DateofAward is entered in the SF_ContractInfo (subform to F_Contract), I want the ProjectPriority to show "OBL" and the Award to be checked, in the F_Project.
Below I've entered a date in the DateofAward and it changes the ProjectPriority and the Award is now checked. This is all good.
I can close the F_Contract, and all is still good. Albeit, the F_Project is still dirty.
When I close or try to edit the F_Project, I get the Write Conflict popup.
How do prevent this Write Conflict from popping up?
Here's my code for the AfterUpdate on the DateofAward text box in the SF_ContractInfo.
I'm going to join that group today.
I have a form that is open from another form. (F_Project has button to open F_Contract. See below)
When a DateofAward is entered in the SF_ContractInfo (subform to F_Contract), I want the ProjectPriority to show "OBL" and the Award to be checked, in the F_Project.
Below I've entered a date in the DateofAward and it changes the ProjectPriority and the Award is now checked. This is all good.
I can close the F_Contract, and all is still good. Albeit, the F_Project is still dirty.
When I close or try to edit the F_Project, I get the Write Conflict popup.
How do prevent this Write Conflict from popping up?
Here's my code for the AfterUpdate on the DateofAward text box in the SF_ContractInfo.
Code:
Private Sub txtDateofAward_AfterUpdate()
DoCmd.RefreshRecord
'This will automatically change the Active Award in the F_Project.
Dim projID As Variant
'get the projectid
projID = Nz(DLookup("ProjectID", "TJ_ProjectContract", "ContractID = " & Me.ContractID), 0)
'check if form is open
If SysCmd(acSysCmdGetObjectState, acForm, "F_Project") <> 0 Then
'form is open
'find the projID on F_Project and change the ActiveAward and ProjectPriority
Set rs = [Forms]![F_Project].Form.RecordsetClone
With rs
.FindFirst "ProjectID = " & projID
If Not .NoMatch Then
.Edit
!ActiveAwarded = Not IsNull(Me!DateofAward)
If Not IsNull(Me.DateofAward) And CurrentProject.AllForms("F_Project").IsLoaded Then
Forms!F_Project.Form.txtProjectPriority = "OBL"
Forms!F_Project.Form.CheckActiveAwarded = True
ElseIf CurrentProject.AllForms("F_Project").IsLoaded Then
Forms!F_Project.Form.txtProjectPriority = ""
Forms!F_Project.Form.CheckActiveAwarded = False
End If
.Update
End If
End With
Set rs = Nothing
Else
'form not open, use SQL update query
CurrentDb.Execute "update T_Project Set ActiveAwarded = " & (Not IsNull(Me!DateofAward)) & " Where ProjectID = " & projID
End If
End Sub
Last edited: