Results 1 to 8 of 8
  1. #1
    Lounger
    Join Date
    Aug 2001
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    append query (access 2000)

    I have created a form with a combo box. After I select the item from my combo box I want the selected item to append to a new table. But my query keeps wanting to append all the records in my combo box. How can I get it to append only the one record I have selected?

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: append query (access 2000)

    What is the code you are using to do the append?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: append query (access 2000)

    You'll have to fill in the blanks, Karen. What do you mean by wanting the selected item to append to a new table? Comboboxes don't have records, they have rows. Do you mean that your append query is appending a new item to a table for each row in the combobox, or what? You'll need to post the SQL for the query if it's a saved query or the code that builds it if not.
    Charlotte

  4. #4
    Lounger
    Join Date
    Aug 2001
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: append query (access 2000)

    How do I look at the append query code?

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: append query (access 2000)

    Open your query in design view.
    Select View | SQL View.
    That's your query in SQL code (What Charlotte was asking for).
    Francois

  6. #6
    Lounger
    Join Date
    Aug 2001
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: append query (access 2000)

    Thanks I was not sure how to bring up the sql code for a query. Here it is below.
    INSERT INTO TABLE1 ( PARTS )
    SELECT [NEWLMPTBL Query].PARTS
    FROM [NEWLMPTBL Query];

  7. #7
    Lounger
    Join Date
    Aug 2001
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: append query (access 2000)

    Here is my sql code for the query.

    INSERT INTO TABLE1 ( PARTS )
    SELECT [NEWLMPTBL Query].PARTS
    FROM [NEWLMPTBL Query];


    When I click on the part in the combo box I want only the part that I highlighted to be added to my new table. (I also have several other fields that are bound to the combo box -- so when I highlight a particular part it brings up specific info regarding that part-- my ultimate goal is to have the highlighted part and all the bound fields that correspond to that part to be added to my new table)

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: append query (access 2000)

    Your query is doing exactly what you've told it to: it's adding all the Parts in NEWLMPTBL Query to Table1. If you want to limit the Part to the selected item in a combobox, you have to add a WHERE clause to your SQL that references that combobox. Something like this:

    INSERT INTO TABLE1 ( PARTS )
    SELECT [NEWLMPTBL Query].PARTS
    FROM [NEWLMPTBL Query]
    WHERE [NEWLMPTBL Query].PARTS = Forms!frmParts!cboParts;

    This assumes that you have a form named frmParts with a combobox named cboParts and that the bound column of the combobox returns a value that will be found in the query NEWLMPTBL Query.
    Charlotte

Posting Permissions

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