Results 1 to 4 of 4
  1. #1
    tpcervelo is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    28

    Insert record from table into different table

    I want to add a selected record from Table1 to Table2. Table1 is displayed to the user in a split form with a Command button for adding records. When the user finds the correct record clicking the button should add only that record to Table2. I have written an append query for the fields I want. On the event I have a DoCmd.Openqery (I have also considered a DoCmd.RunSQL). Howeve, I cannot figure out how to only insert the current record.
    Thanks for any help...

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I haven't used split forms, but try adding a criteria to your query that references the form:

    INSERT INTO...
    SELECT...
    FROM...
    WHERE KeyFieldName = Forms!FormName.ControlName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tpcervelo is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    28

    Insert record from table into different table

    Pbaldy,
    Thank you very much.
    I dumped my SQL code form the query into a string and added your suggestion of the WHERE clause...worked perfectly.
    thanks again...

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ah good, glad it worked for you.
    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. Replies: 1
    Last Post: 12-28-2010, 11:24 AM
  2. Replies: 2
    Last Post: 12-22-2010, 01:46 PM
  3. Replies: 1
    Last Post: 12-20-2010, 03:54 PM
  4. Insert Record checks table
    By pfarnell in forum Forms
    Replies: 13
    Last Post: 09-05-2010, 10:47 AM
  5. Replies: 0
    Last Post: 02-24-2010, 12:56 AM

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