Calculating Values in a text box

  • Thread starter Thread starter alabadi
  • Start date Start date
A

alabadi

Guest
Hi everyone

i have been struggling on this database that i am developing for a while and i haven't found a solution yet.

i have a Two tables

Table 1
"Attendance" with fields
Attendance ID,
Hours,
Group ID.

table 2
"Days" fields,
Day ID
Week beginning
Monday
Tuesday
Wednesday
Thursday
Friday
Hours

now i have created a form from these two tables, and what i wanted was each day of the week i will input a value under the day and i wanted it to be added up and then the result outputted to the "Hours" Box.

My dilema is that although i have figured out how to add up the fields in the form view by changing the Control source for the Hours box to something like
=[Monday]+[Tuesday]....[Friday]
this will only display the value in form view, the table will not update. i guess this is because the control source is not relating to te table anymore.

so if someone has some other ideas i would appreciate it.
regards
Yusef
 
Your table structure is not properly normalized ...
You have repeating groups in your table the the literal day fields ...
Each daily entry should be a seperate record in table ...

RDH
 
RE:calculating Text Box Values

What do you mean by seperate records for days. are you suggesting i have a column called day and then under that have each daym like below

ID Day Hours
1 Monday ?
2 Tuesday ?
3 Wednesday ?
. .........
. .........
5 Friday ?


will this work better, i could try this and see.
You say i have repeated fields in different tables. i need this to link the tables expecially for the hours.
if you can suggest how to do it a different way i would appreciate it.

regards
 
The suggestion from R.Hicks will not work here, you see i need to add up all the hours for a week.
now i have another table named weeks this has 52 weeks of the year so each weeks hours represents 1 week in the weeks table.
by using a seperate record for each day in the days table, i can't see how i can link this to a week in the weeks table.

a bit confusing hey, if any one has any other suggestions please ley me know because i am getting frustrated with this .
 

Users who are viewing this thread

Back
Top Bottom