Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Transfer Spreadsheet - again (XP)

    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?

  2. #2
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Transfer Spreadsheet - again (XP)

    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?

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Transfer Spreadsheet - again (XP)

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



  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Transfer Spreadsheet - again (XP)

    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

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Transfer Spreadsheet - again (XP)

    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 ,<applications Name > object naming rules.

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

Posting Permissions

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