• Transfer Spreadsheet – again (XP)

    Author
    Topic
    #434776

    This has been working OK in the past but now it gives me the error 2391 Field ‘FirstField’ doesn’t exist in destination table ‘tmpImport1’
    DoCmd.TransferSpreadsheet acImport, , “tmpImport1”, strFileName, True
    The table does not exist but this line of cade was working and creating the table I’m sure of it, any ideas?

    Viewing 0 reply threads
    Author
    Replies
    • #1025804

      Found the problem – somehow I had a query named tmpImport1. but here’s another one, and I’m ashamed to say that I used a macro for the first time in ten years, to get around it, but the macro is not flexible enough.

      ‘ Import the text file using the specifiction
      varSessionAttendanceScan = “SessionAttendanceScan”
      DoCmd.TransferText acImportDelim, varSessionAttendanceScan, “tmpImportSessionAttendance”, strFileName, False

      what is wrong with this line?

      • #1025805

        What is the error you get when you use this line?

        • #1025814

          The error was “Kent had a brain meltdown” The line I am actually having a probem with is –
          strTable = “demographics”
          DoCmd.TransferDatabase acImport, “Microsoft Access”, Me.txtLabelPath, acTable, strTable
          This one error with runtime error 2006
          The object name you entered doesn’t follow , object naming rules.

          it looks like I left the destination object name off the end. Now it works. Bad day, lost the plot.

          • #1025815

            You haven’t specified a name for the target (the imported table). If it should have the same name as the source, you can use

            DoCmd.TransferDatabase acImport, “Microsoft Access”, Me.txtLabelPath, acTable, strTable, strTable

    Viewing 0 reply threads
    Reply To: Transfer Spreadsheet – again (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: