title: 3146 ODBC Call Failed - Access 2010
body: <p>Please reference code below...</p>
  
  <pre><code>Private Sub Save_Click()
    On Error GoTo err_I9_menu
    Dim dba As Database
    Dim dba2 As Database
    Dim rst As Recordset
    Dim rst1 As Recordset
    Dim rst2 As Recordset
    Dim rst3 As Recordset
    Dim SQL As String
    Dim dateandtime As String
    Dim FileSuffix As String
    Dim folder As String
    Dim strpathname As String
    Dim X As Integer
  
    X = InStrRev(Me!ListContents, "\")
  
    Call myprocess(True)
  
    folder = DLookup("[Folder]", "Locaton", "[LOC_ID] = '" &amp; Forms!frmUtility![Site].Value &amp; "'")
    strpathname = "\\Reman\PlantReports\" &amp; folder &amp; "\HR\Paperless\"
    dateandtime = getdatetime()
  
    If Nz(ListContents, "") &lt;&gt; "" Then
      Set dba = CurrentDb
  
      FileSuffix = Mid(Me!ListContents, InStrRev(Me!ListContents, "."), 4)
  
      SQL = "SELECT Extension FROM tbl_Forms WHERE Type = 'I-9'"
      SQL = SQL &amp; " AND Action = 'Submit'"
  
      Set rst1 = dba.OpenRecordset(SQL, dbOpenDynaset, dbSeeChanges)
  
      If Not rst1.EOF Then
        newname = Me!DivisionNumber &amp; "-" &amp; Right(Me!SSN, 4) &amp; "-" &amp; LastName &amp; dateandtime &amp; rst1.Fields("Extension") &amp; FileSuffix
      Else
        newname = Me!DivisionNumber &amp; "-" &amp; Right(Me!SSN, 4) &amp; "-" &amp; LastName &amp; dateandtime &amp; FileSuffix
      End If
  
      Set moveit = CreateObject("Scripting.FileSystemObject")
  
      copyto = strpathname &amp; newname
      moveit.MoveFile Me.ListContents, copyto
  
      Set rst = Nothing
      Set dba = Nothing
  
    End If
  
    If Nz(ListContentsHQ, "") &lt;&gt; "" Then
      Set dba2 = CurrentDb
  
      FileSuffix = Mid(Me.ListContentsHQ, InStrRev(Me.ListContentsHQ, "."), 4)
  
      SQL = "SELECT Extension FROM tbl_Forms WHERE Type = 'HealthQuestionnaire'"
      SQL = SQL &amp; " AND Action = 'Submit'"
  
      Set rst3 = dba2.OpenRecordset(SQL, dbOpenDynaset, dbSeeChanges)
  
      If Not rst3.EOF Then
        newname = Me!DivisionNumber &amp; "-" &amp; Right(Me!SSN, 4) &amp; "-" &amp; LastName &amp; dateandtime &amp; rst3.Fields("Extension") &amp; FileSuffix
      Else
        newname = Me!DivisionNumber &amp; "-" &amp; Right(Me!SSN, 4) &amp; "-" &amp; LastName &amp; dateandtime &amp; FileSuffix
      End If
  
      Set moveit = CreateObject("Scripting.FileSystemObject")
  
      copyto = strpathname &amp; newname
      moveit.MoveFile Me.ListContentsHQ, copyto
  
      Set rst2 = Nothing
      Set dba2 = Nothing
  
    End If
  
    Set dba = CurrentDb
  
    Set rst = dba.OpenRecordset("dbo_tbl_EmploymentLog", dbOpenDynaset, dbSeeChanges)
  
    rst.AddNew
    rst.Fields("TransactionDate") = Date
    rst.Fields("EmployeeName") = Me.LastName
    rst.Fields("EmployeeSSN") = Me.SSN
    rst.Fields("EmployeeDOB") = Me.EmployeeDOB
    rst.Fields("I9Pathname") = strpathname
    rst.Fields("I9FileSent") = newname
    rst.Fields("Site") = DLookup("Folder", "Locaton", "Loc_ID='" &amp; Forms!frmUtility!Site &amp; "'")
    rst.Fields("UserID") = Forms!frmUtility!user_id
    rst.Fields("HqPathname") = strpathname
    rst.Fields("HqFileSent") = newname2
    rst.Update
  
    Set dba = Nothing
    Set rst = Nothing
  
  exit_I9_menu:
    Call myprocess(False)
    DivisionNumber = ""
    LastName = ""
    SSN = ""
    ListContents = ""
    ListContentsHQ = ""
    Exit Sub
  
  err_I9_menu:
    Call myprocess(False)
    MsgBox Err.Number &amp; " " &amp; Err.Description
    'MsgBox "The program has encountered an error and the data was NOT saved."
    Exit Sub
  
  End Sub
  </code></pre>
  
  <p>I keep getting an ODBC call error. The permissions are all correct and the previous piece of code worked where there were separate tables for the I9 and Hq logs. The routine is called when someone submits a set of files with specific information.  </p>