Set up....

C

Chris

All the values that are genreated from the calcualtions are completely
different.

Is there any other way you suggest doing this...??? Heres what i have

1 have 2 tables

(a) Meal Uptake:
(b)
School Name* (Primary key)
Meal Id * (Primary key)
Cost Centre
School Name
No Pupils
No tickets
No days
Without tickets
Possible No meals
Supplied tickets
No Meals
% Uptake

What i need is when a user selects a school (from combo box list) my
form should then display the no. pupils and cost centre which is
related to this school.

The no.pupils figure is then multiplyed by the no days (which user
selects from combo box either 1,2,3,4,5) this gives possible no meals.
The no. meals is then divided by possible no meals and expressed as a
percentage for % uptake

I need all these figures to be in my tables as they are going to be
used for monthly reporting for schools based on the possible no meals,
% uptake etc.

What iv done is set up a combo box with school name, no pupils, and
cost center but set columns so that user does not see no. pupils & cost
center but these then appear in text boxes where iv done all the
calculation that i stated above and these all work but dont save into
the required fields in my tables....!!!

Is there an easier way to set this up or anyway that these values can
be saved as am comfused??? as to what to do and what code and where to
put it HEEEEEEEEEEEELLLPPPP its doing my head in
 
R

Rick B

As stated in your post from yesterday, you should not store the calculated
values.

(please stop with the exclamation points - we are trying to help and don't
like to be shouted at).

As your post from yesterday states, it is much more efficient to calculate
the number each time you need it than it is to store the calculation.
 
C

Chris

Sorry

So how do you suggest i set up my database? Should i start again?
so how do i calculate the number each time you need it than it is to
store the calculation?
 
R

Rick B

How are you calculating it in your forms?

If you are storing a record that includes the numbers that make up your
calculation, then you can pull those to your report and also perform the
calculation.

What does one of your records look like from the table? What fields are in
it, and what calculation do you need to perform?
 
C

Chris

iam calculating it in my forms cause thats what my boss wants... he
wants to see all the figures on the forms
iv tried explaining that its not needed and as you said before also.

Right what it is, is that each school kitchen (Primary & Secondary) in
the area fills in a form each week and sends it in to the local
authority. The data is then taken from this form and entered into
various spreadsheets.

so the data the needs to be entered is

1. School name
2. No Pupils
3. Cost center
4. No days
5. Possible No Meals
6. No Meals
7. % Uptake
8. Total Tickets
9. Without tickets
10. Returned Tickets
11. Milk Sold
12. SW MOW
13. SW Lunch Club
14. Adult free meals
15. Secondry Free Pupils ***Just applies to any secondry school**
16. Secondy Cash Banked ***Just applies to any secondry school**
17. Average Sales per pupil per day ***Just applies to any secondry
school**

So....

1. Possible No. Meals is calculated by
No.
Pupils * No. Days
2. %Uptake is calculated by
No
Meals/Poss No Meals
3. Average Sales per pupil per day
Secondy
Cash Banked / No Pupils


What do you suggest i do?


Fie

your help is greatfully accepted thanx
 
R

Rick B

You are not answering my question. What is in your table? What are the
field in the table? You need to simply pull those fields to your forms or
reports. Any calculated data is simply a text box with the formula in it.

If you have a record in your table such as...

Jones Elementary 6 students 5 days

And you want to show that on a report and/or form along with the number of
days multiplied by the number of students, then you can easily do so. Just
pull the four fields listed above (SchoolName, NoPupils, and NoDays) then
also add an unbound text box with the following in it...
=[NoPupils] * [NoDays]


This is a simple example, but you can make it more complex. YOU DO NOT
STORE PossibleNoMeals in your table. You calculate it in your forms,
queries, and reports as I demonstrated above.

Take out any fields from your tables that are calcualted. You don't need
them. When you want to show a calculation, then calculate it.



Another simple example...

Table1
NumberOf Apples
CostPerApple

With this table, you could see the total value of apples in your forms and
reports by including a new control that multiplies NumberOfApples by
CostPerApple. But, there is no need to add a third field to your table
called TotalValueOfApples.

Right:
Table1
NumberOf Apples
CostPerApple

Wrong:
Table1
NumberOf Apples
CostPerApple
TotalValueOfApples
 
C

Chris

the fields in my table's are

(Table 1) Meal Uptake

School name * (Primary Key)
No Pupils
Cost center
No days
Possible No Meals
No Meals
% Uptake


(Table 2) Meal Numbers
Meal Id (Auto No) * Primary Key
School Name
Total Tickets
Without tickets
Returned Tickets
Milk Sold
SW MOW
SW Lunch Club
Adult free meals
Secondry Free Pupils ***Just applies to any secondry school**
Secondy Cash Banked ***Just applies to any secondry school**
Average Sales per pupil per day ***Just applies to any secondry
school**
 
R

Rick B

As I said, get rid of PossibleNoMeals. That is a calculated field.

Get rid of %Uptake. That appears to be a calculation.

In table 2, it also looks like several of your fields may be calculations
and should not be in your table. AverageSalesPerPupilPerDay, for example
seems like a calulated field to me.

Get rid of these and use a textbox in your forms, reports, and queries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Saving Values 3
Values 7
Searching/Repots/Print 0
Not sure what to do 1
Primary Keys 6
Query Results 6
Forms & Queries 0
Not working 2

Top