Good day everybody
I am trying to make a funtion to update table2 from table1 but I have faced an error said
"Run-time error'-2147417848(80010108):
Mehtod 'Fields' of object 'Recordset2' failed"

Can anybody help me in that??

Private Sub updateTable(tbl11 As String, tbl22 As String)

Code:
Dim dbs11, dbs22 As DAO.Database
Dim rs11, rs22 As DAO.Recordset
Dim c1, c2 As Integer
Dim f As Boolean
f = False

    Set dbs11 = CurrentDb
    Set dbs22 = CurrentDb
    Set rs11 = dbs11.OpenRecordset(tbl11, dbOpenDynaset, dbOpenDynamic)
    Set rs22 = dbs22.OpenRecordset(tbl22, dbOpenDynaset, dbOpenDynamic)
        
    If rs11.EOF Then Exit Sub
        
    With rs11
        Do While Not .EOF
            For c1 = 0 To dbs11.Recordsets.Count - 1
                f = False
                For c2 = 0 To (dbs22.Recordsets.Count - 1) Or f = True
                    If .Fields(0) = rs22.Fields(0) And .Fields(1) = rs22.Fields(1) And .Fields(2) = rs22.Fields(2) Then
                        rs22.Fields(3).Value = .Fields(3).Value
                        rs22.Fields(4).Value = .Fields(4).Value
                        rs22.Fields(5).Value = .Fields(5).Value
                        f = True
                    End If
                Next
                rs22.AddNew
                For c = 0 To .Fields.Count - 1
                    rs22.Fields(c) = .Fields(c)
                Next
            rs22.Update
             
            Next
        Loop
    
    End With
    
    rs11.Close
    rs22.Close
      
    
End Sub