Results 1 to 1 of 1

Thread: Import tablename question

  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Import tablename question

    I need help getting the code below to work. I already have code to browse for a file I just need this piece to work. The problem is in the docmd. line. I need for the Function below to just import the filename (not change it). I don't need new code that has wizards and bells - I just need help with this code below. I attached the database with the module . Thanks

    Function Importfile() As Integer
    Dim strwsname As String
    Dim filespec As String
    Dim strfilename, tblname, tablename As String
    Dim i As Integer
    Dim newfilename As String

    newfilename = Mid(Left$([strfilename], InStr(1, [strfilename], ".") - 1), 4)
    tblname = varFileName

    DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel3, "" & tblname & "", filespec, True
    Importfile = 1
    End Function
    Attached Files Attached Files

Posting Permissions

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