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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having a textbox with calculations be entered into table

Status
Not open for further replies.

THEJOESTER

Technical User
Jul 6, 2006
39
US
Hi I am building a reservations program with ticket sales. I have fields such as "adults", "seniors", children. These are also textboxes on a single form. Right next to these I have a textbox for each of them that shows the result of the textboxes times by the price. Then to add all the prices up I have "TotalPrice" textbox. My question is even though i have calculation for the control source on the "TotalPrice" textbox, can I somehow enter this into the table under the field "Total Price" Example:

Seniors(textbox) Price(textbox)(Control Source Seniors*52)

Adults(textbox) Price(textbox)(Control Source Adults*57)

Children(textbox) Price(textbox)(Control Source Children*37)


TotalPrice(Textbox) Control Source: [Seniors]+[Adults]+[Children]

(I need this result to be entered into the table)

PLEASE HELP, THANKS
 
How are your tables set up? The values 52,57, and 37 should be stored in a table. Are they? Also, it seems you are attempting to store a calculated value. Can you justify this?

We need more information about what you are attempting to accomplish as well as your table structure(s).

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I have a table with the following fields: customerID, First Name, Last Name, Zip code, # of seniors, adults, children, payment (cash, credit card, check) and yes/no fields: paid, reservations. The prices are not in the table. I just want the total price in the table, yes I am trying to store a calculated value, Thanks.
 
Seems I have answered this or a vary similar question in the recent past suggesting that you don't have fields with data values as names: "Seniors","Adults","Children",...

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Is there anyway that i can store a calculated value into the table? What do you mean in your last reply? Thanks.
 
I would create this much like the Northwind sample. The customer table would not contain any purchase or payment information. Each Order of tickets/reservations would be nearly the same as the Orders table. Each quantity of a single type of ticket such as seniors would create a record like in the Order Details table. Senior reservations are like a product.

If you look at the Northwind, I believe the UnitPrice is stored in both the Products table and in the OrderDetails table.

I would set up your tables almost exactly like the Northwind except I don't care for the lack of a naming convention in Northwind.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top