Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Unanswered: Query to Form to New Table??

    Can some one help Please!!
    I have set up some tables that store base information.
    I have written a query that takes this base information and pulls it together and does some calculations.
    I have produced a form that displays the output of the query. What I would like to do now is to put some additional text boxes on this form so that additional ad hoc information can be added to the form. Then I would like to create button on the form that saves all the information on the form into a new table of results. The end result being I would have a table of origninal base data and a table of new data that has been calculated via the query and mannual input. Any help on how to do this would be appreciated.

    Thank you

  2. #2
    Join Date
    Apr 2004
    Pune, India
    Well, to start with,
    1) add the text boxes and buttons on your form but don't bound it.
    2) when you click the button designated for saving, save the records in the table using the Insert query from the code. Write seperate queries for inserting the record in the base table and the new table.

  3. #3
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    There's a couple ways to do this.

    It sounds like you want to use a "SELECT INTO" query.

    If you are comfortable with VBA, you could use the ONClick event of the button and execute a select into query to your specifications.

    However I'm curious...

    It sounds like the format of the data will be the same everytime.. would it not be more efficient to have two static tables, and APPEND your new information into the already existing table isntead of creating a whole different table?

    Either way, the basic concept is the same:

    Dim sql As String

    sql = 'INSERT INTO existingTable VALUES " & firstControl & "','" & secondControl

    DoCmd.RunSQL sql

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts