rs.addnew - named range vs. individual cell

J

Jessica

Hi Everyone,

I know I can write the codes as follows to transfer data from Excel to
Access...

..AddNew
!FirstName = strFirst
!LastName = strLast
.Update

but is there anyway to specify and entire named range and have that append
into the access table without specifying each individual field? I've made my
excel record include all fields the same as the access record.

~Jessica
 
R

Roger

Jessica said:
Hi Everyone,

I know I can write the codes as follows to transfer data from Excel to
Access...

.AddNew
!FirstName = strFirst
!LastName = strLast
.Update

but is there anyway to specify and entire named range and have that append
into the access table without specifying each individual field? I've made
my
excel record include all fields the same as the access record.

~Jessica

Hi Jessica,

You can probably do something like this...

rs.AddNew
For i = 1 To rs.Fields.Count
rs(i - 1) = Range("whatever").Cells(1, i)
Next
rs.Update

Roger
 
Top