Results 1 to 3 of 3
  1. #1
    cmorton is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    1

    Check Box Copy Data

    Hello,

    I have a project I'm trying to work on. In this project I would like the action of "checking" a check box to move data from one table to another. I thought I could get away with doing this via an append query, however because I am using a multi-part primary key it will not allow it. I'm now looking for advice on this.


    Table 1 - Products
    Below is show a list of products that I have, I would like to check the box and ONLY the selected products will appear in Table 2.




    Table 2 - Line Items(Receipt)
    This table would be a list of only what the customer has selected (Checked) from Table 1.




    I made a query of the Table 1 - Products to query ONLY checked boxes, works great. However, I can not get the data in that query to move into the Table 2 - Line Items. I tried to make a second query that would query the first query, and append it into the Line Items table, however my order table has a multi-part primary key which I believe is blocking the append.
    How can I work around this? Are there other ways to "copy" data from one table to another? Essentially the flow I'm going for is that inside of 1 order, can include multiple products; that's where my line item table comes in to play. So each order has multiple line items in it, each line item refers to 1 product.


    Let me know if I can answer any questions or provide any more insight into what I'm trying to do.




    Thank you,

    -Chris

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    What you are doing is like driving a car from the back seat. One should never manipulate data this way via tables - only forms and queries, and I see no mention of a form here. Even if it were possible (and I think what you want is not) I couldn't bring myself to figure it out for you and aid you in going down that slippery slope! Furthermore, it looks like what you want to do would be to repeat the storage of data you already have. Better you should build a form if you are already quite knowledgeable about database normalization, otherwise I strongly urge you to read up on the subject before you get yourself into a swamp, so to speak.
    Last edited by Micron; 03-27-2016 at 10:39 PM. Reason: clarifed the urge
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    If you're moving all the data, why not reference the Key for that record? Thats what its there for. Table 2 should just list the key to the selected product and the quantity ordered. If you're doing stock management on the products table, you need to run an update query that will take the quantity ordered number from the quantity in stock. (test these first obviously)

    Micron - I always test my querys before assigning them to a button on a form. In fact I often work backwards after I have them on a form. I screenshot the code then work through it manually on the querys seeing everything is doing what it should. (not arguing just giving a different view)

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

Similar Threads

  1. Replies: 14
    Last Post: 01-07-2014, 04:20 PM
  2. Replies: 2
    Last Post: 08-22-2013, 12:02 AM
  3. Copy Data
    By ahmed.osama in forum Access
    Replies: 5
    Last Post: 08-31-2012, 02:27 PM
  4. How do I copy all the data from a Column
    By winterh in forum Queries
    Replies: 5
    Last Post: 04-18-2012, 08:13 AM
  5. COPY DATA and TRIM
    By Ed H in forum Access
    Replies: 1
    Last Post: 01-01-2009, 07:01 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