Hi,
I have the following tables:
tblOrders
tblOrderLine
tblProducts
I have a sub-total field in the table tblOrderLine, in my form the user can select the product using a drop down list which is linked to the ProductID stored in tblOrderLine, they then enter a quantity (also stored in tblOrderLine), on the form i do not have a clue as to how it will calculate a sub-total of that purchase...pleaseeeeeeeee help i would really appreciate it! please please please
Also, even if i do get the sub-totals, how would that be added together for the Total field in tblOrders?! please please help!
6 1743 MMcCarthy 14,534
Recognized Expert Moderator MVP
Hi,
I have the following tables:
tblOrders
tblOrderLine
tblProducts
I have a sub-total field in the table tblOrderLine, in my form the user can select the product using a drop down list which is linked to the ProductID stored in tblOrderLine, they then enter a quantity (also stored in tblOrderLine), on the form i do not have a clue as to how it will calculate a sub-total of that purchase...pleaseeeeeeeee help i would really appreciate it! please please please
Also, even if i do get the sub-totals, how would that be added together for the Total field in tblOrders?! please please help!
The subtotal is a calculated field and as such should not be stored in the table.
In your form footer of the orderline form you can put an unbound textbox and set the control source as follows: - =Sum([ProductPrice]*[Qty])
Oh, Thanks sooo much!, I have heard that calculated fields shouldnt be stored but i just didnt know what else to do, thanks a lot for your help!
I tried doing that, however, it just displays "#error'
I don't know why it doesn't work; perhaps because it cannot look up the Price of the products from the tblOrderLine form?!
Could you let me know as to how i could get it to look up that value?! please please help
nico5038 3,080
Recognized Expert Specialist
Guess you can have multiple combinations of [ProductPrice] and [Qty] in your detail rows.
Best to first create a query to extract all rows from your table and add a field:
select [ProductPrice]*[Qty] as Amount, ...
Just "forget" to place that in the details section and use in the footer:
=Sum([Amount])
Also make sure the fieldname (see properties) is NOT [Amount] as Access will see that as a circular reference...
Nic;o)
Sorry, I'm very very new to Queries, could you give me some more info please, i need to save all of these sub totals to give me a Total for the tblOrders, how would i do this, or would i need to store this field?
NeoPa 32,557
Recognized Expert Moderator MVP
As per your other question ( Querying database by date), you need to post the table MetaData.
Without this we can only guess at your fieldnames and as you don't seem experienced enough to translate this into workable SQL that isn't working for you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Anonymous |
last post by:
Hi all,
I have a form people use to enter checking data. One of the fields is
calculated based on finding the difference of two input fields on the form.
Here are the fields:
CheckAmount...
|
by: Miguelito Bain |
last post by:
hi everybody.
i'm trying to find out what you can and can't do with/in calculated
fields. any help, pointers, and/or advice would be greatly
appreciated. i'm a newbie, but i want to learn, and...
|
by: John Bahran |
last post by:
I am trying to use calculated fields in my query but all the results
are zero ven when they're not. Please help. Thanks.
|
by: david |
last post by:
Hi,
I have a form with a couple of calculated fields.
I want to put some code into the 'Form-Load' event to set various
object states on the form, depending on the value of these fields.
The...
|
by: Ryker |
last post by:
I have a Purchase Order where I have a calculated field called Price
that is calculated by multiplying Qty * Sales Price. I have 10 of
these fields...Price 1 - Price 10 (for each line of the PO). ...
| |
by: Olveres |
last post by:
Hi,
I have managed to work out how to add new lines into a calculated text
box. However in this text box some of the outcome fields are empty
however when previewing the report it includes the...
|
by: Henrik |
last post by:
The problem is (using MS Access 2003) I am unable to retrieve long
strings (255 chars) from calculated fields through a recordset.
The data takes the trip in three phases:
1. A custom public...
|
by: jcf378 |
last post by:
hi all.
I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ).
However, when I click "Filter by...
|
by: Matthew Wells |
last post by:
If I have a calculated field that returns a value from a udf, does that
field get calculated even when it's not being used in a Select statement? I
knw that if a calculated field's formula is...
|
by: mkbrady |
last post by:
I have a query that includes calculated fields that generate numeric results.
I have wrapped conversion functions CLng() and CDdl() around the calculated
fields to ensure the data types are...
|
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,...
| |
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,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |