By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

Returning orders

P: n/a
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

Dec 14 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.