473,399 Members | 2,278 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,399 software developers and data experts.

How to display the total of an order in a form

11
In an order system, there are tables of customers, products, orders, and order details, with the main fields listed as follows:

tblCostomer: CustomerID, CustomerName, ...
tblProduct: ProductID, ProductName, ...
tblOrder: OrderID, CustomerID, OrderDate, ...
tblOrderDetail: OrderID, ProductID, UnitPrice, Amount, Total, ...

I have created a query "qryTotalByOrder" which will sum up the total for each order by grouping corresponding products in that order:

qryTotalByOrder: CustomerID, OrderID, OrderDate, Total

I would like to add an unbound text box in a form " which will display the Total of a particular order by entering the orderID as a parameter. What do I need to put in the Source of Data of the textbox? Thanks.
Sep 4 '08 #1
1 1239
Stewart Ross
2,545 Expert Mod 2GB
Hi. The domain lookup function DLookup will do this for you. Assuming the OrderID field is numeric, enter

Expand|Select|Wrap|Line Numbers
  1. =DLookup("[Totals]", "[QryTotalByOrder]", "[OrderID] = " & [YourOrderIDTextboxName])
If the order ID is a string, you will need single quotes on either side of its value:
Expand|Select|Wrap|Line Numbers
  1. =DLookup("[Totals]", "[QryTotalByOrder]", "[OrderID] = '" & [YourOrderIDTextboxName] & "'")
-Stewart
Sep 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ovidal | last post by:
Hi, Newbie here. After a few days of sleep depravation i gave up and decides to ask for help, so anything you can do for me will be much apreciated, what i´´m trying to do is organize the...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
4
by: mukeshhtrivedi | last post by:
I have TYPE field which has 3 data like HEAD, TRACK and PANEL. Now whenever any person works on HEAD we put 8 Hrs in HRS filed and in LABOR field it reflects the dollar value automatically like...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
33
by: potassium flower | last post by:
I am trying to create a food order system for a restaurant. I have tried using both the DSum and Sum functions to calculate the total cost of an order. The total cost is a textbox on the form...
1
by: bruce24444 | last post by:
First of all I'm new to the forum and am working on my first database. So far I think I've done not too bad but have hit a stumbling block for which I'm not sure how to get around. What I have is...
0
by: remya1000 | last post by:
I need to display current month,last 3months,6months and 1year records seperatly. and first i'm tring to display current month's records. and the error i received is this. Microsoft VBScript...
7
lee123
by: lee123 | last post by:
hey all, i have made a order form with all the works. in vb 6 and in this form i have been trying to get a total of the items that a customer would have ordered. to make things make sense i have in...
6
by: Gilberto | last post by:
Hello I have a table (BOM TOTAL L1 V1) created by a query which only contains one field (TCL1) with ONE record. I've been trying to display this record on a form (either in a textbox or a label)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.