Hi!
When returning an order,
I have the following code:
strOlinje = "INSERT INTO tblReturn
(RetOrdernr,RetDate,RetTime,RetCustID,RetEmployeeI D,RetDescription,RetPrinted,
RetReturn,RetReturnr,RetReturDate) " _
& "SELECT
Ordernr,myDate,myTime,CustID,EmployeeID,Descriptio n,myPrinted,Return,Returnr,ReturDate
" _
& "FROM tblOrders " _
& "WHERE OrderID = " & Forms!frmOrder!OrderID
CurrentDb.Execute strOlinje
'Now insert the orderlines...
strDelOlinje = "INSERT INTO tblReturnorderlines
(RetOrdreID,RetVareID,RetPris,RetMengde,RetRabatt, RetMiljoavg,RetReturnert)
" _
& "SELECT
OrdreID,VareID,Pris,Mengde,Rabatt,Miljoavg,Returne rt " _
& "FROM tblDelordrer " _
& "WHERE Returnert = true AND OrdreID = " &
Forms!frmOrdrer!frmDelordrer!OrdreID
CurrentDb.Execute strDelOlinje
Now this works fine, except....it doesn't do the insert in the
tblReturnOrderlines.
However, when I run a query against this table, I'll get the desired
result. It has inserted the data.
What is going on here?
Is this the way to do it or am I way out on the marshes?
Me.Name