Thread: Check Box Copy Data
03-27-16, 22:24 #1Registered User
- Join Date
- Mar 2016
Unanswered: Check Box Copy Data
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.
03-28-16, 04:43 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
If you are creating an order then use a firm to create the order header ( the data that us pertinent to all itmes in tbe order eg customer, invouce addres, delivery address, deluvery details their ref yoyr ref etc.
Then create an irder detail sub form which picks up the pk of the order and whatever else to be the pk of the order detail. That whatever else could be the internal product number or better yet a line number that ties back to the customer order. You can always enforce a unique constraint so there can only be one riw of a product for that customer order in tbe order details.
Use a combo/lust box in yhe order detail table to select a product. Or if you have multi thousand products a combo in the order details header or footer that pushes the selected profuct ud to the row when a new row is created.I'd rather be riding on the Tiger 800 or the Norton