S
Sherwood
Greetings,
I am having an issue where a "Write Conflict" dialog box displays when I
navigate to another record. The 3 options on this dialog are "Save Record",
"Copy to Clipboard", and "Drop Changes". This write conflict seems to occur
after I press a command button on the main data entry form. This command
button updates the current record with whatever items were checked on the
form (as well as sends an email to the appropriate recipient). The code
below is called from the "'Click" event of this button and updates a field in
the table with the appropriate values:
Sub ProductsExpectedtoUse()
Dim db As DAO.Database
Dim lngID As Long
Dim strProductList As String
Dim strSQL As String
Set db = CurrentDb
'// Assign the value of the ID field to the variable, "lngID".
lngID = Me.txtID.Value
If Forms![frmMainSurvey].ChecHomeImp.Value = -1 Then
strProductList = "Home Improvement Loans"
Else
strProductList = ""
End If
If Forms![frmMainSurvey].CheckVacationHome.Value = -1 Then
If strProductList = "" Then
strProductList = strProductList & "Buying a Vacation Home"
Else
strProductList = strProductList & ", Buying a Vacation Home"
End If
Else
strProductList = strProductList & ""
End If
.....
If strSQL = "" Then
strSQL = "Update [Survey Results] SET ProductsExpectedtoUse = '" &
strProductList & "' WHERE ID = " & lngID
End If
db.Execute strSQL
db.Close
Set db = Nothing
End Sub
I have tried using DoCmd.Save after calling this routine, but that still
doesn't prevent the "Write Conflict" dialog box from appearing. Any
suggestions?
Thanks in advance!
I am having an issue where a "Write Conflict" dialog box displays when I
navigate to another record. The 3 options on this dialog are "Save Record",
"Copy to Clipboard", and "Drop Changes". This write conflict seems to occur
after I press a command button on the main data entry form. This command
button updates the current record with whatever items were checked on the
form (as well as sends an email to the appropriate recipient). The code
below is called from the "'Click" event of this button and updates a field in
the table with the appropriate values:
Sub ProductsExpectedtoUse()
Dim db As DAO.Database
Dim lngID As Long
Dim strProductList As String
Dim strSQL As String
Set db = CurrentDb
'// Assign the value of the ID field to the variable, "lngID".
lngID = Me.txtID.Value
If Forms![frmMainSurvey].ChecHomeImp.Value = -1 Then
strProductList = "Home Improvement Loans"
Else
strProductList = ""
End If
If Forms![frmMainSurvey].CheckVacationHome.Value = -1 Then
If strProductList = "" Then
strProductList = strProductList & "Buying a Vacation Home"
Else
strProductList = strProductList & ", Buying a Vacation Home"
End If
Else
strProductList = strProductList & ""
End If
.....
If strSQL = "" Then
strSQL = "Update [Survey Results] SET ProductsExpectedtoUse = '" &
strProductList & "' WHERE ID = " & lngID
End If
db.Execute strSQL
db.Close
Set db = Nothing
End Sub
I have tried using DoCmd.Save after calling this routine, but that still
doesn't prevent the "Write Conflict" dialog box from appearing. Any
suggestions?
Thanks in advance!