Error 3167 Please help

Discussion in 'MS Access' started by am_25, Jun 15, 2007.

  1. am_25

    am_25 New Member

    Joined:
    Jun 15, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I'm fairly new to Access 2000. I have this code, I'm trying to delete a record, once I uncheck the check box. It is deleting fine, but after deleting it is giving this error.

    error 3167

    Please help
    Code:
    Option Compare Database
    Dim conDatabase As adodb.Connection
        Dim numRecordsAffected As Long
        Dim rstImpactApp As adodb.Recordset
        
    Private Sub Check12_Click()
    Set conDatabase = CurrentProject.Connection
        Set rstImpactApp = New adodb.Recordset
    
     If (Check12.Value = -1) Then
        Dim strSQL As String
        Me![1619IDRequirementDocumentation] = [Forms]![f04RequirementDocument]![tb19IDRequirementDocumentation]
        Me![tb1609IDApplication] = Me![09IDApplication]
        
            
     ElseIf (Check12.Value = 0) Then
        Dim strSQL As String
           
           
        DoCmd.SetWarnings False
      
    
        strSQL = "DELETE t16ImpactedApplication19x09.*" & _
                 "FROM t16ImpactedApplication19x09 " & _
                 "WHERE t16ImpactedApplication19x09.[1619IDRequirementDocumentation]=" & _
                 Me![tb19IDRequirementDocumentation].Value & _
                 " and t16ImpactedApplication19x09.[1609IDApplication]=" & _
                 tb1609IDApplication.Value & " ;"
        'MsgBox strSQL
        
       ' DoCmd.RunSQL strSQL
        
      'Set rstImpactApp = conDatabase.Execute(strSQL, numRecordsAffected, adExecuteNoRecords)
      conDatabase.Execute strSQL, numRecordsAffected, adExecuteNoRecords
     ' rstImpactApp.MoveNext
      
          Set conDatabase = Nothing
      
        
        
    End If
    End Sub
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice