Results 1 to 2 of 2
  1. #1
    ssalem is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    39

    Dropping last field on excel imported worksheet

    I am having an issue with an Access import. It worked correctly bringing in a sharepoint spreadsheet until a date field was added to the spreadsheet and the structure to the database. Now it drops any additional fields that are added. At first I thought if I added a filler field after the field I needed that it would still drop the last field but it dropped them both. If I insert the field in the middle of the spreadsheet....(where I really want it). It drops the last field of the email address. Which I need to send out notifications. I have tried designing a complete new table and importing it, but it continues to do the same thing.

    Not sure if my problem is with the spreadsheet or Access. Somehow it is still looking at the old structure when I import even if I create a new table. Not sure what is happening.

    I have tried researching online about what is happening but have not been able to find anything. I found one instance but it was not resolved.



    I am somewhat a novice and most of the projects I work on I do alot of research.

  2. #2
    ssalem is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    39
    On further note....I created a whole new database. When I import the spreadsheet in through the import function as an excel spreadsheet it works. This is the code in my module for importing data. Don't understand why it is dropping the last field of my spreadsheet.

    Public Function ClearTableImport()
    Dim db As DAO.Database
    Set db = CurrentDb
    On Error Resume Next: db.TableDefs.Delete "tlbImports": On Error GoTo 0
    db.TableDefs.Refresh
    DoCmd.SetWarnings False
    DoCmd.RunSQL "DELETE PAFS2.* FROM PAFS2;"
    DoCmd.SetWarnings True
    DoCmd.TransferSpreadsheet _
    TransferType:=acImport, _
    SpreadsheetType:=acSpreadsheetTypeExcel9, _
    TableName:="PAFS2", _
    FileName:="http://xxx.com/xx/xxxx/xxx.xlsx", _
    HasFieldNames:=True, _
    Range:="Worksheet name!a1:t100"
    db.TableDefs.Refresh

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 08-09-2012, 12:06 PM
  2. Replies: 6
    Last Post: 11-05-2011, 09:01 AM
  3. VBA to Import Excel Worksheet
    By bdaniel in forum Programming
    Replies: 2
    Last Post: 11-23-2010, 10:53 AM
  4. Importing the second excel worksheet
    By geoffwbailey in forum Programming
    Replies: 1
    Last Post: 06-25-2010, 12:16 AM
  5. Replies: 0
    Last Post: 03-15-2010, 01:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums