Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing an Excel Comma Separated Values File into Microsoft Access. 1

Status
Not open for further replies.

Really

Programmer
Jan 3, 2002
1
US
How do I import an excel CSV file into an Access database form.

I designed a form in Access and I created a command button. Whenever I click on the command button, I want the command button to access the file located in c:\work\test.csv, get the information in the test.csv file and use it to populate the fields in my form. I DO NOT want to open this excel file, but I want the value in this excel file to get POPULATED in the fields in my Access Form.

What's the best and simple way to do this. My Excel version is 97 and my Access version is also 97.

Thank YOU.
 
Hi ,

You must first import the file once manually with the import wizard.
When you get to the last window of the wizard, you must click the "advanced" button and then "save as" and give the import specification a name.
Then you create an event procedure for your button. Type the command
sub button1_onclick

docmd.TransferText acImportDelim,"SpecName","tablename","filename" = full path

end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top