From your description I suggest you begin by tweaking the design of your
tables:
TblCourse
CourseID
Coursename
TblCourseLevel
CourseLevelID
CourseID
CourseLevelDescription
CourseLevelChargePerHour
TblTeacher
TeacherID
TeacherFirstName
TeacherLastName
TblCourseLevelTaughtByTeacher
CourseLevelTaughtByTeacherID
CourseLevelID
TeacherID
TblStudent
StudentID
StudentFirstName
StudentLastName
<<Other relevant student fields>>
The above assumes that some or all of your courses have different levels
such as beginner, intermediate and advanced. You did not say anything about
your fee structure so I assumed you charge by the hour and that each course
level has a certain charge, If yiu do something different, you need to
modify TblCourseLevel accordingly. If you post back with how you charge I
will help you incorporate your fee structure into your tables. The above
also assumes you have multiple teachers and that a teacher may teach more
than one course level.
Given all of the above, students register for lessons in a course level.and
take one or more sessions on different dates with a teacher that teaches the
course level.
TblStudentLessonRegistration
StudentLessonRegistrationID
StudentID
CourseLevelID
CourseLevelTaughtByTeacherID
StartDate
TerminationDate
TblStudentLesson
StudentLessonID
StudentLessonRegistrationID
StudentLessonDate
Students pay for studentlessons monthly. The amount due depends on how many
studentlessons the student received duing the month.
TblStudentPayment
StudentPaymentID
StudentLessonRegistrationID (StudentID can be found from
TblStudentLessonRegistration)
PaymentYear
PaymentMonth
PaymentDue
PaymentDate
The number of studentlessons for a month is found by counting the
StudentLessonDates that occurred during the month. The amount due is
calculated by (number of studentlessons) X CourseLevelChargePerHour. You can
use two queries for this.
Include in the first query TblStudentLessonRegistration and
TblStudentLesson. Include the fields:
StudentLessonRegistrationID From TblStudentLessonRegistration
CourseLevelID From TblStudentLessonRegistration
StudentLessonDate From TblStudentLesson
Add a calculated field with this expression:
LessonYear:Year(StudentLessonDate)
Add a calculated field with this expression:
LessonMonth:Month(StudentLessonDate)
Set the criteria for LessonYear as:
[Enter The Year Of The Lessons]
Set the criteria for LessonMonth as:
[Enter The Month Of The Lessons]
Now with the query in design view, click on the Sigma (looks like a capital
E) button in the menu at the top of the screen. This converts your query to
a totals query. Under StudentLessonRegistrationID, change GroupBy to Count.
The query will now count the number of lessons for each
StudentLessonRegistrationID for the year and month you enter. When you run
this query, you will be first prompted for the Year of the lessons and then
you will be prompted for the month of the lessons. For the month, enter a
number between 1 and 12.
Include in the second query the first query and TblCourseLevel. Join
CourseLevelID in TblCourseLevel to CourseLevelID in the first query. Include
the fields:
All the fields from the first query
CourseLevelChargePerHour From TblCourseLevel
Add a calculated field with this expression:
AmountDue:[CourseLevelChargePerHour] X [CountOfStudentLessonRegistrationID]
Now with the query in design view, click on the Query Type button in the
menu at the top of the screen. Change the query to an append query and
append to TblStudentPayment.
1. Append StudentLessonRegistrationID in the query to
StudentLessonRegistrationID in TblStudentPayment
2. Append LessonYear in the query to PaymentYear in TblStudentPayment
3. Append LessonMonth in the query to PaymentMonth in TblStudentPayment
4. Append AmountDue in the query to PaymentDue in TblStudentPayment
On the first of every month you need to make sure all lessons for the
previous month were entered in
TblStudentLesson. Then you run the second query to enter all the payment due
records in TblStudentPayment. Then you need a form for entering payments as
students make payment.
Base your query that will automatically list students that have not paid
fees for a certain month on TblStudentPayment. Set the criteria for
PaymentYear to:
[Enter Payment Year]
Set the criteria for PaymentMonth to:
[Enter Payment Month]
Set the criteria for PaymentDate to:
Is Null
You said you are a new Access user. If you need further help with the above
so you can concentrate on providing music lessons, I can help you for a
reasonable fee. Contact me at my email address below.
Good Luck,
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)