2003 Excel import not working in ACCESS 2010

I am testing databases to get ready for migration to ACCESS 2010.  however, many of the datasbases I did not create so am having issues.  Below module apparenlty worked in ACCESS 2003 but does not work in ACCESS 2010.  When I do a Debug Compile, it stops at the rs.Edit line indicating that Method or data member not found.  However, this method does seem to exist.

Sandra

Public Function ImportExcelData2()
    Dim objFileSystemObject As Scripting.FileSystemObject
    Dim objFolder As Scripting.Folder
    Dim objFile As Scripting.File
    Dim objXLApp As New Excel.Application
    Dim objXLWorkbook As Excel.Workbook
    Dim objXLSheet As Excel.Worksheet
   
    Dim sAccountNumber As String
    Dim sUserDef2CD As String
    Dim iRow As Integer
   
    Dim sSQL As String
    Dim rs As Recordset
   
   
    Set objFileSystemObject = New Scripting.FileSystemObject
    Set objFolder = objFileSystemObject.GetFolder(SOURCE_IMPORT_FOLDER)
    'Import file
    For Each objFile In objFolder.Files
        Set objXLWorkbook = objXLApp.Workbooks.Open(SOURCE_IMPORT_FOLDER & "\" & objFile.Name)
        Set objXLSheet = objXLWorkbook.Sheets("Sheet1")
       
        iRow = 2
        Do
            sAccountNumber = Trim(objXLSheet.Cells(iRow, 1))
            sUserDef2CD = Trim(objXLSheet.Cells(iRow, 6))
           
            sSQL = "SELECT ACCT_NBR, USER_DEF_2_CD "
            sSQL = sSQL & "FROM Accounts "
            sSQL = sSQL & "WHERE ACCT_NBR='" & sAccountNumber & "' "
            Set rs = CurrentDb.OpenRecordset(sSQL, dbOpenDynaset)
            If rs.RecordCount > 0 Then
                'Update USER_DEF_2_CD
                rs.Edit   'INDICATES METHOD DOES NOT EXIST HERE
                    rs!USER_DEF_2_CD = sUserDef2CD
                rs.Update
            End If
           
            iRow = iRow + 1
        Loop While sAccountNumber <> ""
       
    Next objFile
   
    objXLWorkbook.Close SaveChanges:=False
    Set objXLWorkbook = Nothing
    objXLApp.Quit
    Set objXLApp = Nothing
   
   
CleanExit:
    MsgBox "Import Success. " & vbCrLf & iRow & " Excel Rows Processed..."
    DoCmd.Hourglass False
    DoCmd.Close acForm, "frmProcessing"
    Exit Function

ErrHandler:
    MsgBox Err.Description
    GoTo CleanExit
    Resume
   
End Function
Sandra SmithRetiredAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

als315Commented:
You function is worked in my Access 2010.
Try to declare rs as DAO.Recordset:
Dim rs As DAO.Recordset
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sandra SmithRetiredAuthor Commented:
That was it.  I inherited a lot of code like this.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.