I have an type mismatch error that occurs on the fifth line of the code. Set rs = db.OpenRecordset("Header_New", dbOpenTable). I don't know enough about OpenRecordset command but from what I gathered from Microsoft the syntax is correct, but I may be wrong. Is there a specific reference that I need to use to make this work or is the code off? Just FYI I am moving more than one cell and the excel data will be populating a preexisting db.
Thanks Rob.
Code:
Sub AccessHeader()
Dim db As Database, rs As Recordset, r As Long
Sheets("Header Access Trnsfr").Select
Set db = OpenDatabase("F:\TestQUOTE.mdb")
Set rs = db.OpenRecordset("Header_New", dbOpenTable)
r = 2 ' the start row in the worksheet
Do While Len(Range("A" & r).Formula) > 0
With rs
.AddNew
.Fields("Name") = Range("A" & r).Value
.Update
End With
r = r + 1 ' next row
Loop
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End Sub