virtaccess
06-15-2007, 01:44 AM
Hi,
I have this code, it works fine, by deleting the record. But after deleting, when I place the cursor elsewhere, it gives Record is deleted 3167 error. Please help
Record is deleted. (Error 3167)
You referred to a record that you deleted or that another user in a multiuser environment deleted. Move to another record, and then try the operation again.
Private Sub Check12_Click()
'Me![1619IDRequirementDocumentation] = [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation]
'Me![tb1609IDApplication] = Me![09IDApplication]
'Fix for defect 2: Ramanan Pathmaraj
If (Check12.Value = -1) Then
Dim strSQL As String
Me![1619IDRequirementDocumentation] = [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation]
Me![tb1609IDApplication] = Me![09IDApplication]
'strSQL = "INSERT INTO t16ImpactedApplication19x09 (1619IDRequirementDocumentation,1609IDApplication)" & _
" VALUES (" & [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation] & _
"," & Me![09IDApplication] & ");"
'MsgBox (strSQL)
'DoCmd.RunSQL strSQL
ElseIf (Check12.Value = 0) Then
'Dim strSQL As String
Dim conDatabase As ADODB.Connection
Dim numRecordsAffected As Long
Set conDatabase = CurrentProject.Connection
DoCmd.SetWarnings False
strSQL = "DELETE t16ImpactedApplication19x09.*" & _
"FROM t16ImpactedApplication19x09 " & _
"WHERE t16ImpactedApplication19x09.[1619IDRequirementDocumentation]=" & _
Me![tb19IDRequirementDocumentation].Value & _
" and t16ImpactedApplication19x09.[1609IDApplication]=" & _
tb1609IDApplication.Value & " ;"
'MsgBox strSQL
DoCmd.RunSQL strSQL
'conDatabase.Execute strSQL, numRecordsAffected, adExecuteNoRecords
conDatabase.Close
Set conDatabase = Nothing
End If
End Sub
I have this code, it works fine, by deleting the record. But after deleting, when I place the cursor elsewhere, it gives Record is deleted 3167 error. Please help
Record is deleted. (Error 3167)
You referred to a record that you deleted or that another user in a multiuser environment deleted. Move to another record, and then try the operation again.
Private Sub Check12_Click()
'Me![1619IDRequirementDocumentation] = [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation]
'Me![tb1609IDApplication] = Me![09IDApplication]
'Fix for defect 2: Ramanan Pathmaraj
If (Check12.Value = -1) Then
Dim strSQL As String
Me![1619IDRequirementDocumentation] = [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation]
Me![tb1609IDApplication] = Me![09IDApplication]
'strSQL = "INSERT INTO t16ImpactedApplication19x09 (1619IDRequirementDocumentation,1609IDApplication)" & _
" VALUES (" & [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation] & _
"," & Me![09IDApplication] & ");"
'MsgBox (strSQL)
'DoCmd.RunSQL strSQL
ElseIf (Check12.Value = 0) Then
'Dim strSQL As String
Dim conDatabase As ADODB.Connection
Dim numRecordsAffected As Long
Set conDatabase = CurrentProject.Connection
DoCmd.SetWarnings False
strSQL = "DELETE t16ImpactedApplication19x09.*" & _
"FROM t16ImpactedApplication19x09 " & _
"WHERE t16ImpactedApplication19x09.[1619IDRequirementDocumentation]=" & _
Me![tb19IDRequirementDocumentation].Value & _
" and t16ImpactedApplication19x09.[1609IDApplication]=" & _
tb1609IDApplication.Value & " ;"
'MsgBox strSQL
DoCmd.RunSQL strSQL
'conDatabase.Execute strSQL, numRecordsAffected, adExecuteNoRecords
conDatabase.Close
Set conDatabase = Nothing
End If
End Sub