Results 1 to 8 of 8
  1. #1
    Wookiefoot is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    9

    Question INSERT INTO statement was not found in field - I'm so lost

    Bare with me. I'm fairly new to access and I'm taking over a database that was built by someone else with zero previous experience.

    I'm getting "The INSERT INTO statement contains the following unknown field name: 'Draka Part #' Make sure you have typed the name correctly, etc"

    Click image for larger version. 

Name:	error.jpg 
Views:	9 
Size:	54.2 KB 
ID:	28483
    So I go into the TRExportMasterTrunks macro, check the Q_MakeMasterTrunks query to make sure everything is spelled correct and it is.
    Click image for larger version. 

Name:	error2.jpg 
Views:	9 
Size:	137.1 KB 
ID:	28484
    It auto populates 'Draka Part #' after entering the Table Name which I'm pulling the column headers from 'FIBER TRUNKS' (linked excel spreadsheet).

    In the 'MasterTrunks' table, that the Q_MakeMasterTrunks
    Code:
    SELECT [FIBER TRUNKS].[(EEFGH)], [FIBER TRUNKS].Color, [FIBER TRUNKS].[Fiber Count], [FIBER TRUNKS].[Fiber Type], [FIBER TRUNKS].[Cable Color], [FIBER TRUNKS].Description, [FIBER TRUNKS].[Corning Part #], "" AS Corning_MatNum, 1.11 AS Corning_Inv, "" AS Corning_units, 1.11 AS Corning_StdPrice, [FIBER TRUNKS].[Superior Part #], "" AS Superior_MatNum, 1.11 AS Superior_Inv, "" AS Superior_units, 1.11 AS Superior_StdPrice, [FIBER TRUNKS].[AFL Part #], "" AS AFL_MatNum, 1.11 AS AFL_Inv, "" AS AFL_units, 1.11 AS AFL_StdPrice, [FIBER TRUNKS].[TLC Part #], "" AS TLC_MatNum, 1.11 AS TLC_Inv, "" AS TLC_units, 1.11 AS TLC_StdPrice, [FIBER TRUNKS].[OCC Part #], "" AS OCC_MatNum, 1.11 AS OCC_Inv, "" AS OCC_units, 1.11 AS OCC_StdPrice, [FIBER TRUNKS].[OFS Part #], "" AS OFS_MatNum, 1.11 AS OFS_Inv, "" AS OFS_units, 1.11 AS OFS_StdPrice, [FIBER TRUNKS].[Draka Part #], "" AS DrakaPrysmian_MatNum, 1.11 AS DrakaPrysmian_Inv, "" AS DrakaPrysmian_units, 1.11 AS DrakaPrysmian_StdPrice, [FIBER TRUNKS].[Hitachi Part #], "" AS Hitachi_MatNum, 1.11 AS Hitachi_Inv, "" AS Hitachi_units, 1.11 AS Hitachi_StdPrice, [FIBER TRUNKS].[Berktek Part #], "" AS Berktek_MatNum, 1.11 AS Berktek_Inv, "" AS Berktek_units, 1.11 AS Berktek_StdPrice, [FIBER TRUNKS].[Commscope Part #], "" AS Commscope_MatNum, 1.11 AS Commscope_Inv, "" AS Commscope_units, 1.11 AS Commscope_StdPrice INTO MasterTrunksFROM [FIBER TRUNKS];
    query creates, I notice that the data type for Draka Part # is Short Text instead of Yes/No.
    Click image for larger version. 

Name:	error3.jpg 
Views:	9 
Size:	162.4 KB 
ID:	28485
    When I attempt to change the data type to match the others, it says there is not enough memory or space to change data types.

    Would this possibly be causing the error I'm getting? If so, I've read a few workarounds by creating copy of the table and making an append query to change the data types, but I'm still a bit lost on that part.

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    I feel your pain having to work with this database with VERY BAD table field names. Try wrapping the variable with [] everywhere in the query - [Draka Part #]. This would need to be done with any field name that contains spaces or non-standard characters in it. I would do it for the fieldnames with just a number as well (that is so weird....).

  3. #3
    Wookiefoot is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    9
    In the code I posted above it seems I have [] around each variable already, no? I'm a novice so I may be looking in the wrong place.
    I believe it allowed me to change the data type from Short Text to Yes/No once and it got rid of the error but for some reason it didn't save. Now when I try it gives me Click image for larger version. 

Name:	error3.jpg 
Views:	8 
Size:	48.4 KB 
ID:	28489

    Hmm, off to google I go.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Do a database compact/repair, then try changing the data type again.

  5. #5
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    Apologies, I didn't look closely at your images. Why try to change from Short Text to Yes/No? If you just got this database handed to you, doing that probably isn't a safe thing to do. Without seeing the database, don't know. Perhaps try to Compile/Compact/Repair the database and see if that makes a difference. With that error message about disk space, look at https://social.msdn.microsoft.com/Fo...orum=accessdev

  6. #6
    Wookiefoot is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    9
    Quote Originally Posted by davegri View Post
    Do a database compact/repair, then try changing the data type again.
    I tried that a few times already. I even put the database on our network with plenty of space/memory and it gave the same space error as running locally. It's roughly 140mb compacted so I'm sure why 380gb of freespace and 32gb ram on a server isn't enough.

  7. #7
    Wookiefoot is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    9
    Quote Originally Posted by jwhite View Post
    Apologies, I didn't look closely at your images. Why try to change from Short Text to Yes/No? If you just got this database handed to you, doing that probably isn't a safe thing to do. Without seeing the database, don't know. Perhaps try to Compile/Compact/Repair the database and see if that makes a difference. With that error message about disk space, look at https://social.msdn.microsoft.com/Fo...orum=accessdev
    No worries, I'll check that link out. The Draka Part # is something I was requested to add. I followed the same format as the other vendors we have added. I'll try to work around the space issue and then my best bet seems to get a hold of the original developer.

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    If you have a split database, you can't change the table structure of a linked table from the front-end. You need to load the back-end to do it.

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

Similar Threads

  1. INSERT INTO statement
    By berderder in forum Programming
    Replies: 4
    Last Post: 06-03-2016, 06:00 PM
  2. Insert into with a WHERE statement
    By hazeleyre23 in forum Access
    Replies: 10
    Last Post: 04-06-2016, 08:28 AM
  3. Lost and Found Database
    By Squigglethecow in forum Access
    Replies: 1
    Last Post: 09-19-2012, 08:42 PM
  4. Insert Into statement
    By TimMoffy in forum Programming
    Replies: 7
    Last Post: 07-13-2012, 07:10 AM
  5. Insert statement
    By crowegreg in forum Programming
    Replies: 2
    Last Post: 08-19-2011, 02:20 PM

Tags for this Thread

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