copying a field??

tru-

Registered User.
Local time
Yesterday, 22:31
Joined
Jan 29, 2006
Messages
18
I didnt know whether to post this here on in the table forum, so sorry if its in the wrong place!!

10309543998.jpg


10309512643.jpg


Ok, so in the frist screenshot the green box is based off of the table labelled 3. The red box is comprised of the InvoiceID from table 1, ProductID from table 2 and name/price is drawn from table 3.

The green box is used to view products, the red is an invoice. How do I add the currently viewed product (in this case, a case) to the invoice? I need to copy the product ID from table 3 to table 2. How do I go about this?

Many thanks! :D
 
someone please? I really need to get this done, I can't ask anyone/anywhere else
I've been told to try
Code:
INSERT INTO [tblInvoiceToProduct] ([Product ID])  _SELECT ProductID FROM [tblProduct]
but that doesnt work
 
Doing this with code is possible and really not too complicated, and you have options. You could use ADO or DAO but you need to add references to them. An easier way may be to create a query to select the record you want to add and then change the type of query to an "add" query. Change the options you need, save and run the query from the "add to shopping list" command button.

You probably know this already, but when you add or delete records, you will receive a confirmation msgbox. To bypass this...
docmd.setwarnings = false
docmd.runquery ...
docmd.setwarnings = true

I would suggest making sure the query is going to delete the correct records before using the setwarnings command.

Hope this helps some.

-alteque
 

Users who are viewing this thread

Back
Top Bottom