Results 1 to 6 of 6
  1. #1
    zlloyd1 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    5

    Question Cannot use INSERT INTO with access

    I am trying to insert values into a table of a database that I have created in MS Access 2010 using the INSERT statement, but it WILL NOT WORK!!
    This is what I have tried most recently, Click image for larger version. 

Name:	syntaxerror.JPG 
Views:	16 
Size:	100.2 KB 
ID:	9039


    but it keeps telling me there is a syntax error that I cannot see anywhere??
    If anyone can see what I am doing wrong with this please let me know, and thanks in advance!!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Please show the fieldNames and datatypes for you table Employee.

    You need a Values in your statement.

    INsert into EMPLOYEE( field1...., fieldx) VALUES (firstfldvalue, second fldValue...)

    see details at http://www.techonthenet.com/sql/insert.php
    Last edited by orange; 09-03-2012 at 02:02 PM. Reason: spelling and additional info

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    And in case it isn't clear, in Access you can only have a single INSERT statement in the query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    zlloyd1 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    5
    Alright, but that is disheartening since my task is to add information to several different instances of the same fields. For instance, I need to add 7 different first names to the FName field, seven different last names to the LName field, seven different addresses to Address, etc.... I am supposed to do this using the INSERT statement in order to follow assignment parameters correctly.

  5. #5
    zlloyd1 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    5
    Here is the table Employee: Attachment 9041 I also need to add SQL code to create and insert a unique identifier to the Employee_ID and JTKey fields, but that is a different issue!!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I get an error on your attachment. You can do this to insert multiple lines if the data is in a table:

    INSERT INTO...
    SELECT...
    FROM...
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Trying to insert jpgs into access
    By CNE5X in forum Access
    Replies: 1
    Last Post: 06-07-2012, 09:06 AM
  2. Replies: 8
    Last Post: 03-21-2012, 09:39 AM
  3. Access wont insert the record
    By chaitanyakvs in forum Queries
    Replies: 1
    Last Post: 03-01-2011, 10:25 AM
  4. Help about access INSERT INTO statement
    By ducthang88 in forum Programming
    Replies: 7
    Last Post: 12-03-2010, 08:40 AM
  5. Access insert into query...
    By xmetisx in forum Queries
    Replies: 2
    Last Post: 04-06-2010, 02:27 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