D
disneygoof via AccessMonster.com
Greeting and Happy Thanksgiving (2008) to all...
I have read many, but not all, the threads on WRITE CONFLICT dialog box
poping up. I have tried all the ideas presented, at least I think I have,
yet I can not get mine to stop poping up.
I have two forms: frmProjectInfo (tblProjectInfo) and frmContactInfo
(tblContactInfo)
frmProjectInfo does many things, including storing an Integer in the
textboxes for contacts
frmContactInfo stores all the relavent info, address, name, phone#'s etc...
On frmProjectInfo, I have a number of textboses for selecting CONTACTS...
becasue we deal with contractors, architects and engineers...I have supplied
code for one of them below...basically they are all coded the same
on frmProjectInfo
all variables are defined at the top (Dim cID, Public varCurrent)
Private Sub ProjectArchitect_DblClick(Cancel As Integer)
cID = Nz(Me.ProjectArchitect, 0)
'cRec = Me.CurrentRecord '(for testing only not used)
varCurrent = "ProjectArchitect"
If cID <= 0 Or IsNull(cID) Then
Me.ProjectArchitect = Null
End If
If IsNull(Me.ProjectArchitect) Or Me.ProjectArchitect = 0 Then
Info = 0
Else
Info = "[ContactID]=" & Me.ProjectArchitect
End If
DoCmd.OpenForm "frmContactInfo", , , Info
End Sub
Basically the above opens the fmContactsInfo and either goes to the record in
the textbox on frmProjectInfo or opens to nothing so we can add a new record.
This all works Fine to here...
on frmContactsInfo is a Button btnUploadData. This is supposed to CHANGE the
integer value for the new customer on frmProjectInfo, refresh frmProjectInfo
and Ensure that the current record on frmProjectInfo is set current, then
closes frmContactInfo
on frmContactInfo
Private Sub btnupdateData_Click()
On Error GoTo Err_btnupdateData_Click
Dim cRec As Integer
Me.ContactCell.SetFocus
If CurrentProject.AllForms("frmProjectInfo").IsLoaded Then
If Me.ContactID > 0 Then
DoCmd.RunSQL "Update tblProjectInfo Set " & Forms
("frmProjectInfo").varCurrent & " = " & Me.ContactID & " where ProjectID = "
& Forms!frmProjectInfo.ProjectID
End If
cRec = Forms!frmProjectInfo.CurrentRecord
Forms!frmProjectInfo.Refresh
DoCmd.GoToRecord , , cRec
End If
DoCmd.Close acForm, "frmContactInfo"
Exit_btnupdateData_Click:
Exit Sub
Err_btnupdateData_Click:
MsgBox err.Description
Resume Exit_btnupdateData_Click
End Sub
I get the write conflict dialog box after/during/before? this fires Forms!
frmProjectInfo.Refresh...which does not make sence to me. I know this is the
issue, becasue if I rem it out, I do not get the message. BUT then I do get
the message when I try to close frmProjectInfo.
I have tried me.dirty, me.refresh, forms!frmProjectInfo.form.refresh, Forms!
frmProjectInfo.Refresh, forms!frmProjectInfo.form.dirty = false...and more.
I have placed them in many different locations to see if it's a sequence
issue...nothing seems to work
Hope you can follow this...Thoughts?
Thanks,
DAVID
I have read many, but not all, the threads on WRITE CONFLICT dialog box
poping up. I have tried all the ideas presented, at least I think I have,
yet I can not get mine to stop poping up.
I have two forms: frmProjectInfo (tblProjectInfo) and frmContactInfo
(tblContactInfo)
frmProjectInfo does many things, including storing an Integer in the
textboxes for contacts
frmContactInfo stores all the relavent info, address, name, phone#'s etc...
On frmProjectInfo, I have a number of textboses for selecting CONTACTS...
becasue we deal with contractors, architects and engineers...I have supplied
code for one of them below...basically they are all coded the same
on frmProjectInfo
all variables are defined at the top (Dim cID, Public varCurrent)
Private Sub ProjectArchitect_DblClick(Cancel As Integer)
cID = Nz(Me.ProjectArchitect, 0)
'cRec = Me.CurrentRecord '(for testing only not used)
varCurrent = "ProjectArchitect"
If cID <= 0 Or IsNull(cID) Then
Me.ProjectArchitect = Null
End If
If IsNull(Me.ProjectArchitect) Or Me.ProjectArchitect = 0 Then
Info = 0
Else
Info = "[ContactID]=" & Me.ProjectArchitect
End If
DoCmd.OpenForm "frmContactInfo", , , Info
End Sub
Basically the above opens the fmContactsInfo and either goes to the record in
the textbox on frmProjectInfo or opens to nothing so we can add a new record.
This all works Fine to here...
on frmContactsInfo is a Button btnUploadData. This is supposed to CHANGE the
integer value for the new customer on frmProjectInfo, refresh frmProjectInfo
and Ensure that the current record on frmProjectInfo is set current, then
closes frmContactInfo
on frmContactInfo
Private Sub btnupdateData_Click()
On Error GoTo Err_btnupdateData_Click
Dim cRec As Integer
Me.ContactCell.SetFocus
If CurrentProject.AllForms("frmProjectInfo").IsLoaded Then
If Me.ContactID > 0 Then
DoCmd.RunSQL "Update tblProjectInfo Set " & Forms
("frmProjectInfo").varCurrent & " = " & Me.ContactID & " where ProjectID = "
& Forms!frmProjectInfo.ProjectID
End If
cRec = Forms!frmProjectInfo.CurrentRecord
Forms!frmProjectInfo.Refresh
DoCmd.GoToRecord , , cRec
End If
DoCmd.Close acForm, "frmContactInfo"
Exit_btnupdateData_Click:
Exit Sub
Err_btnupdateData_Click:
MsgBox err.Description
Resume Exit_btnupdateData_Click
End Sub
I get the write conflict dialog box after/during/before? this fires Forms!
frmProjectInfo.Refresh...which does not make sence to me. I know this is the
issue, becasue if I rem it out, I do not get the message. BUT then I do get
the message when I try to close frmProjectInfo.
I have tried me.dirty, me.refresh, forms!frmProjectInfo.form.refresh, Forms!
frmProjectInfo.Refresh, forms!frmProjectInfo.form.dirty = false...and more.
I have placed them in many different locations to see if it's a sequence
issue...nothing seems to work
Hope you can follow this...Thoughts?
Thanks,
DAVID