Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    20

    Unanswered: Import Table using Runcommand

    Hi All,

    I need to have a command button that will import a table into Access. the table will always be saved in My documents-C:\Mydocuments\whatever.txt
    The users of this database do not know how to import a file so I have to create a button that will do this for them. Does anyone know what I need to do. Runcommand Import will only take me as far as My documents. I need a full Import command. Please help.

    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Look into the "DoCmd.TransferText" action.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Mar 2004
    Posts
    128

    Lightbulb Runcommand

    Hi,
    You can use the macro 'TransferText' property to import the file.
    After that in you can call the macro when ever you want.
    Or you can use "convert macro to VB", Then you will see the VB code of importing and exporting files to Access.

    I hope I helps...

  4. #4
    Join Date
    Jun 2004
    Posts
    20

    Transfer Text Action

    I tried the Transfer Text action and it seems to be the perfect answer to my problem-however, the macro asks for a specification name. It says to select from a list but when I click on the list box, I have no data to select from.
    What do you think?

    Thanks again for your help...

  5. #5
    Join Date
    Mar 2004
    Posts
    128

    Lightbulb Transfare text

    Hi,
    The specification name you have to do it by your self only in the first time.
    You can do that by these steps:
    1. Go to the "File" menu.
    2. Choose "Get external data" ---> Import
    3. Then you choose the Table or what you ever want to import.
    4. Access create Specification pattern of your import. This is used like a pattern to all the data that you import in the future.
    5. After you end, when you go to the macro you will see the specification name that you gave in the import wizard, appears in the specification name list.

    By this way Access willn't ask you in the future to do that more.

    I hope it helps you

    Best regards...

Posting Permissions

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