views:

32

answers:

4

Hello,

I has not a lot of experience in VBA programming. What I need - is the possibility to create a simple form to extract some Excel file to the defined table by adding the records. Could you please tell me what function or a set of functions can be used in this case: to open the Excel file, define the spreadsheet, extract data insert them to the db table.

Thank you in advance,

Best regards, Greg.

A: 

Check out this web site to get a good start.

KevenDenen
A: 

KevenDenen,

Thank you a lot for your answer.

Sincerely, Greg.

Greg
If you like the answer, vote it up and/or check the little checkmark to indicate that it answered your question. Putting in an answer that says you like an answer is not really the way to do things in this venue. Check the faq here, http://stackoverflow.com/faq.
KevenDenen
A: 

In your access database, create a module with the following code to import a spreadsheet:

Function import()

basedir = "INSERT YOUR SPREADSHEET HERE"

DoCmd.TransferSpreadsheet _
            acImport, _
            acSpreadsheetTypeExcel9, _
            "TABLENAME", _
            basedir, _
            False
End Function

VBA Code to select and define a range should be fairly simple, and I do not have it to hand, if you still need help with this let me know and I will edit this in when I have more time.

Waller
A: 

There is a book that I still find useful called 'Integrating Excel and Access' published by O'Reilly ((c) 2006; ISBN 0596009739). Still in publication (check Amazon) and worth the price if you are doing a lot of interaction between Excel and Access.

TonBill