Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 How SQL Insert table with value from other table

Author  Topic 

mrdotnetid
Starting Member

8 Posts

Posted - 2006-12-06 : 08:19:23
Hello,
I have 2 table

One ---> tbCustomer with Columns CustId, CustName, Address
Two ---> tbOrders with Columns OrderId, CustId, Qty, ProductId

In my Application (Textbox) I was show CustName. Know I wan't To Insert tbOrders (OrderID, CustId, Qty, ProductId) with Parameter CustName In my Textbox. Please Help How To do it in MS Access.

Thx.

Rudianto

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-06 : 09:13:16
insert tbOrders (OrderID, CustID, Qty, ProductID)
select #OrderID#, CustID, #Qty#, #ProductID#
from tbCustomers
where custname = #custname#


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -