Write data to a table

bodhran1

Dazed and Confused
Local time
Today, 04:27
Joined
Mar 27, 2002
Messages
43
Hi all,

It's great to have you all back. I got nervous when this site was down for a few days. Newbies like me rely on you guy more than you know!

Here's my question:

I have a table called tblECR. It has 10 fields in it. ECRno, User and Mgr, as examples.

I also have small amount of data that I read from an Excel file ,lets call it data(1) thru data(10)

Can you tell me ,in Newbie language ;) , how to write this data to my table.


Thanks in advance and again, I'm really glad your all back!!
 
How are you reading the data from Excel? If you have linked the Excel file as a link table then you need to use an append query to add the data to your table. Otherwise look at Recordsets ie assigning the Excel data to variables and then using addign the recordset eg

D1 = myFirsytField
D2 = mySecondField
etc

MyRecordset.Addnew
MyRecordset("Field1Name") = D1
MyRecordset("Field2Name") = D2
etc
MyRecordset.update

HTH
 
I've read the data into an array (?) called data(1), data(2), data(3)....data(10)

But I'll try your ideas instead!


Thanks for the help!! :D
 
I had considered that, but the Excel file is a huge database with info about 100+ user.

I only need the 10 items that apply to the current user.

Then I'll need that info multiple times during the program, so it seemed to make sense to extract the 10 items, write them to the table, then goto the table when I need the data.

Does this makes sense? I'd be curious if you woud all attack it the same way.


Dave
 

Users who are viewing this thread

Back
Top Bottom