Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting up totals in database from a text box PLEASE HELP

Status
Not open for further replies.

THEJOESTER

Technical User
Jul 6, 2006
39
US
I am writing a database for ticket sales. My form has a senior, adult, children text box to enter how many of each are getting tickets. The only thing is a i need a text box that will tell me on each record how many tickets i have sold. Can you please help me. The columns in the table are named exactly like above....senior, adult, children.
 
Have you tried to create a TextBox with ControlSource like this ?
=[senior]+[adult]+[children]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes that only does it for the form, but i need it to do it for whole database in the table.
 
Use an expression in the query retrieving the tickets:
Total: senior + adult + children

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes but will this display the information in the actual form or will it only display it in the query. I need it to display how many people we have sold for one train ride in the actual form so i know how many people i can still sell for.
 
How would i go about displaying the query on the form. Much appreciated.
 
when i create a query in gives me the sum of adults, sum of children and sum of seniors is there anyway i can combine those to make it one. And then when i try to point to the query in in the control source it displays a #name? in the text box. Can you help me?
 
SELECT SUM(Adults) As CountofAdults, SUM(Children) As CountOfChildren, SUM(Senior) As CountOfSenior, SUM(Adults + Children + Senior) As Total FROM .....

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Sorry But could you please a little more specific, where do enter this information? is the "SUM" apart of it and is this an expression?
 
when in the query design grid, go to View -> SQL; you will be able to see the SQL that Access has generated for you. Why don't you post the entire SQL.


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
This is what is in the query: SELECT [7/12/06].Adults, [7/12/06].Children, [7/12/06].Seniors
FROM [7/12/06];
This gives me the sum of each type
 
There's no way that SQL gives the SUM of anything....

Do you really have your table named 7/12/06? Do you create a new table for each day's activity?
What is the table structure for the data?

Have you read either of the links below?




Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top