Results 1 to 2 of 2
  1. #1
    ammu_sridhar is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    2

    Insert Query output into a table

    Hello all,

    I am writing a form programming where I have to fill table T3 from two tables
    T1 and T2 upon a button click.

    I have a complecatd query Q1 on T1 & T2 whose output should be inserted into
    T3.

    Would anybody help me how to achieve this in form programming.

    If I write query as SELECT ....... FROM T1, T2 ......etc.... and double click
    on it, I am getting the list of rows I wanted.



    If I write query as INSERT INTO T3 SELECT ....... FROM T1, T2 ......etc....
    and double click on that, all these rows are inserted into T3.

    But the question now is, how to execute this with FORM PROGRAMMING.....

    Any help is appriciated ....

    Thanks
    Sri

  2. #2
    ammu_sridhar is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    2
    Hello all,

    Atlast I could find the solution myself.

    Public Sub testInsert()

    Dim qd As QueryDef

    Dim db As Database

    Set db = CurrentDb

    Set qd = db.QueryDefs("InsertMe")

    qd.Execute

    End Sub

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

Similar Threads

  1. vba code for regression analysis P value output
    By Frangipani in forum Programming
    Replies: 0
    Last Post: 02-04-2009, 06:26 AM
  2. Updating two tables using SQL Insert Into
    By glazzaro in forum Programming
    Replies: 0
    Last Post: 05-02-2008, 10:52 PM
  3. Insert Dash between set of Numbers
    By Jhankish in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:02 AM
  4. Output Query to Text
    By denileigh in forum Queries
    Replies: 1
    Last Post: 05-27-2006, 12:34 PM
  5. How to output only current record in query
    By mslieder in forum Access
    Replies: 0
    Last Post: 01-20-2006, 05:48 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 - Senior Forums