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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top