473,419 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Returning orders

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
0 1072

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris | last post by:
Hi, I am currently designing a simple service orders database. I have played around with MySQL a bit but this is the first time I'm using it in anger, I have a few design queries to make sure I am...
4
by: Steve | last post by:
I have a products table where the PK is ProductID. Also have the standard Orders table and OrderDetails table. I created a query that joins the Orders table and OrderDetails table. The query...
3
by: Anne | last post by:
Hi I have got a table with some sales transactions. It has got 3 fields 1) Ordernumber 2) Item number 3) Shippingdate Now I want to make ONE (not two) query that shows how many different...
0
by: gsb58 | last post by:
Hi! In my database (ms access 2000) I have a routine for returning orders. User can check a checkbox in the frmOrderdetails (a subform of frmOrders) next to each orderline, and click a button....
15
by: Daniel Rudy | last post by:
Hello, Consider the following code: /* resolve_hostname this resolves the hostname into an ip address. */ static void resolve_hostname(char result, const char hostname, const char server) {
3
by: Mike P | last post by:
Is it possible to return a dataset from a stored procedure, or would you need to write the SQL in your .cs file to return the dataset? Any assistance would be really appreciated. Cheers, ...
11
by: Steven Blair | last post by:
Hi, I am using ODBC namespace and MySQl 4.1 and have hit this problem a number of times and had to do some nasty coding to get round the problem. I am convinced there is a easier way to do...
8
by: Martin | last post by:
I hope not, but, I think the answer to this question is "it can't be done". Northwind sample database. Orders form. Go to a new record. Select a customer in "Bill To:" Don't enter any...
2
by: robert.waters | last post by:
I need to perform the following: - select the most recent X number of records in a table (there is a timestamp field) - select the Nth occurrence of X number of records ex: - most recent 10...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.