I have created a database to create and store purchase orders. My tables are as follows -
Tbl Order details (Qty, desc,price,total),
Tbl Order no (ON, date, date required, supplier)
Tbl Supplier (Supplier name, address)
I have created the Purchase order in form with subform. I am having difficulty getting the form to create a final total. I have tried '=sum([total]).
7 2544
You are going to have a lot more trouble than trying to do a simple addition.
1. You need first to not use reserevd words such as ON and Date.
2. You need primary keys and foreign keys (you have no relations between your tables.
3. You need to normalize your database.
I would suggest reading up on normalization.
cheers,
Thanks for your help I'll have a read..I do have relationships attached screen dump, showing tables/relationships. NeoPa 32,556
Expert Mod 16PB
Sandretto, Part of your task when posting your question is to consider what information is required to enable someone to understand it well enough to give an answer.
In this case (all) the details of the table structure are required, as well as enough information about your form to indicate what might be going wrong. It's hard to answer a question when there is no real question there.
Apologies for the lack of information. I have attached a screen print from design view of form.
I need to add up a grand total from the 'Total' column of the subform. On the screen print you can see the attempt I made at the sum, but this doesn't work.
SQL for Main form - - SELECT [ORDER NO].[TO:], [ORDER NO].[ORDER NO], [ORDER NO].[ORDER DATE], [ORDER NO].[DELIVERY ADDRESS], [ORDER NO].[REQUIRED DATE], [DELIVERY ADDRESS].NAME, [DELIVERY ADDRESS].[ADDRESS 1], [DELIVERY ADDRESS].[ADDRESS 2] AS [DELIVERY ADDRESS_ADDRESS 2], [DELIVERY ADDRESS].[ADDRESS 3] AS [DELIVERY ADDRESS_ADDRESS 3], [DELIVERY ADDRESS].POSTCODE, SUPPLIER.[SUPPLIER NAME], SUPPLIER.ADDRESS1, SUPPLIER.[ADDRESS 2] AS [SUPPLIER_ADDRESS 2], SUPPLIER.[ADDRESS 3] AS [SUPPLIER_ADDRESS 3], SUPPLIER.[POST CODE]
-
FROM SUPPLIER INNER JOIN ([DELIVERY ADDRESS] INNER JOIN [ORDER NO] ON [DELIVERY ADDRESS].[DEL ADD CODE] = [ORDER NO].[DELIVERY ADDRESS]) ON SUPPLIER.[SUPPLIER CODE] = [ORDER NO].[TO:];
SQL from subform - - SELECT [ORDER DETAILS].QUANTITY, [ORDER DETAILS].DESCRIPTION, [ORDER DETAILS].PRICE, [QUANTITY]*[PRICE] AS TOTAL
-
FROM [ORDER DETAILS];
Sorry again for my mistake. I hope I have given the full question and information required NeoPa 32,556
Expert Mod 16PB Sandretto:
On the screen print you can see the attempt I made at the sum, but this doesn't work.
I'm afraid we cannot see it. It seems you've done a much better job now certainly. All text should be posted as text though. Pictures are not of good enough quality generally for passing textual information. We would also need an explanation of what does happen if, as you say, it doesn't work. Not working can mean so many things.
I suggest you also respond to Mshmyob's post directly. He has offered some important advice.
Morning
I'm not very good at this forum thing! I am still learning tho. I have good news I have worked out how to do what I requested. I 'normalised' my database from the advice give by mshmyob. I then thought about what I wanted. I entered "=sum([Quantity])*([Price]") into the form footer on the subform, this calculated the total and then on the main form entered "=(order details subform)!Grand Total" All is working order thanks for everyones help and sorry for the confusion on my part.
NeoPa 32,556
Expert Mod 16PB Sandretto:
I'm not very good at this forum thing! I am still learning tho.
That's the important thing :-) No apologies necessary. You did a fine job considering it's all very new for you.
Good job on working out the solution as well ;-)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Lapchien |
last post by:
I have a purchase order database, i use 1 particular supplier very often -
i'd like to put a button on my form which, when pressed, 'auto-filled'
several fields (like supplier name, address,...
|
by: John Hunter |
last post by:
I've recently had a nasty problem with the "Invalid reference to the
property Form" error in subforms - nasty because it doesn't seem to
consistently happen to all forms which contain the same...
|
by: sasan3 |
last post by:
I have a main form "topform" contaning "subform1" and "subform2"
The goal is:
I need to requery subform2 on CURRENT event of subform1, and I need to
load subform2 contents based on settings on...
|
by: Rajani |
last post by:
Hello,
I have two tables. pomain and posub
pomain: ponumber,podate,issuedby
posub: posubid,ponumber,itemcode,qty,price
I am new to dotnet. How can i add data to these two tables. 1 record...
|
by: Diggar |
last post by:
I have a data base with about 4 different tables.
1. Cust info
2. Supplier info
3. Order History
4. Order details.
Order history and details are on one form with details being the
subform....
|
by: John Torres |
last post by:
I have added a "Preview Report" button on my main Form Page to mainly "print preview" current page including the 1st subform and I already designed the Report Page for it. But for some reason it...
|
by: yltang |
last post by:
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,...
|
by: GLEberts |
last post by:
Novice looking for some direction!!
I am trying to have a text box autopopulate with a number added to it at the end and I am having a difficult time doing this.
Example:
(1) I have a combo...
|
by: EINSTEIN1221 |
last post by:
I have created a program for our company in Access 2003 that allows users to track inventory, pricing and create purchase orders. I have also created a similar table for tickets. My purchase order...
|
by: 125a29 |
last post by:
hi i'm trying to update total order cost in order table , basically what i want when i edit order item table such as changing quantity then it automatically update the total cost in order table
i...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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...
|
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...
| |