locked
Access 2010: Insert records from Access query into linked SQL table RRS feed

  • Question

  • Hi.  I'm trying to save the results of an Access query with a filter on it into a linked SQL table.  I want this event to take place when a user presses a button on a form which is based on the filtered query.  Please help with a simple example as I'm struggling with the syntax.  Thanks.
    Thursday, May 26, 2016 8:28 PM

Answers

  • Okay, it might work for what you need. Just execute the APPEND query in the click of the button. Good luck!
    Thursday, May 26, 2016 9:10 PM
  • >>>I want this event to take place when a user presses a button on a form which is based on the filtered query.  Please help with a simple example as I'm struggling with the syntax.

    According to your description, you could use INSERT INTO statement to add a record or multiple records to a table. This is referred to as an append query.

    Multiple-record append query:

    INSERT INTO target [(field1[, field2[, …]])] [IN externaldatabase] SELECT [source.]field1[, field2[, …] FROM tableexpression

    Single-record append query:

    INSERT INTO target [(field1[, field2[, …]])] VALUES (value1[, value2[, …])

    For more information, click here to refer about INSERT INTO Statement (Microsoft Access SQL)

    Friday, May 27, 2016 5:54 AM

All replies

  • Hi. Have you tried using an APPEND query? Just curious...
    Thursday, May 26, 2016 8:39 PM
  • No.  I'll look into it though.
    Thursday, May 26, 2016 8:54 PM
  • Okay, it might work for what you need. Just execute the APPEND query in the click of the button. Good luck!
    Thursday, May 26, 2016 9:10 PM
  • >>>I want this event to take place when a user presses a button on a form which is based on the filtered query.  Please help with a simple example as I'm struggling with the syntax.

    According to your description, you could use INSERT INTO statement to add a record or multiple records to a table. This is referred to as an append query.

    Multiple-record append query:

    INSERT INTO target [(field1[, field2[, …]])] [IN externaldatabase] SELECT [source.]field1[, field2[, …] FROM tableexpression

    Single-record append query:

    INSERT INTO target [(field1[, field2[, …]])] VALUES (value1[, value2[, …])

    For more information, click here to refer about INSERT INTO Statement (Microsoft Access SQL)

    Friday, May 27, 2016 5:54 AM