Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178

    Question Unanswered: macro - upload file from textbox

    I have a macro that uploads an excel file into a table. I want to be able to change the name of the file to upload by changing the file name in a text box on a form.
    is there a way to call a textfield value from a form into a macro?

  2. #2
    Join Date
    Nov 2003
    Location
    Warren, PA
    Posts
    52
    Quote Originally Posted by actionant
    I have a macro that uploads an excel file into a table. I want to be able to change the name of the file to upload by changing the file name in a text box on a form.
    is there a way to call a textfield value from a form into a macro?
    You can do it with code
    DoCmd.TransferSpreadsheet acImport, 8, "tablenamewheredatawillendup", txtboxwithfilename, True, ""

    you will have to specify the full path and filename "C:\excelfiles\sample.xls"
    or if the xls files will be in the same folder you can set a static path and variable file name like below
    where txtboxwithfilename is place
    "C:\path\" & txtboxname
    bhummel

  3. #3
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178
    thanks
    helps a lot

Posting Permissions

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