Results 1 to 5 of 5

Thread: Import File

  1. #1
    Join Date
    Sep 2005
    Posts
    28

    Unanswered: Import File

    In VB Code:


    How can I write import the file from Excel file to Access table? Thanks.

  2. #2
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    The following example is taken from the Access Help files....

    Example
    The following example imports the data from the specified range of the Lotus spreadsheet Newemps.wk3 into the Microsoft Access Employees table. It uses the first row of the spreadsheet as field names.

    DoCmd.TransferSpreadsheet acImport, 3, _
    "Employees","C:\Lotus\Newemps.wk3", True, "A1:G12"

    Check Access help for the correct parameters you need (I think if you remove the 2nd parameter <3>, then it will default to Excel.

    Chris

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Sample Importing routine

    Here's a sample importing routine you can play with. Let me know if it helps.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Sep 2005
    Posts
    28
    And also,
    If I do in Macro, which Action for Import ?

    Thanks.

  5. #5
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    Quote Originally Posted by accessman3
    And also,
    If I do in Macro, which Action for Import ?

    Thanks.
    The TransferSpreadsheet action would seem like the obvious choice

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •