Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42

    Trying to make payments system for dance school

    Hi



    I am trying to make a system of payments for a dance school database.

    I have student and class table. These are linked in a junction table enrolments.

    Having a payments field in the junction field means I can set up datasheets for students by class and how much money each class has taken.

    I want to make a payments table that will record each payment. What am i doing wrong here please.

    I have attached a screenshot. Let me know if i need to upload the DB.

    Thanks. Click image for larger version. 

Name:	Screenshot 2015-09-04 18.48.11.jpg 
Views:	23 
Size:	110.9 KB 
ID:	21957

  2. #2
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    Just to be clear i need to do some renaming. The amountpaid in tblPayments refers to each individual payment.

    The amountpaid in tblEnrollments refers to the total amount paid to date on each class by each student.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    In a conventional accounting system, customer charges and payments need not be associated with each other. Charge and payment transactions are associated with customer account - the difference of their sums is the customer account balance. Payments do not care what was bought - it is just a remittance on the account.

    However, if you want to associate payment with specific enrollment, and partial or excess payments will be accepted, need an EnrollmentID PK in tblEnrollments. Then save that PK as FK in tblPayments (not StudentID and ClassID) and AmountPaid and DepositPaid will not be in tblEnrollments. Total AmountPaid should be calculated, not saved into table.

    If each enrollment will have only one associated payment then record that payment in tblEnrollments and tblPayments is not needed - but since you seem to allow partial payments (as indicated by DepositPaid field), this approach does not seem appropriate.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    Ok great.

    That is very helpful. I did think this would be the route a while ago HOWEVER,

    I am using Enrollments as my junction table for classes and students.

    Can i have a new field enrollments as a primary key somehow or do i need a seperate table??

    Thanks

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    I already described creating a PK field in tblEnrollments. Read my previous post again.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    Will the junction table tblEnrollments still work for the many-to-many relationship without the classID and studentID being PK.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Certainly. They aren't currently saved as FK anywhere. You can still set them as a compound index to prevent duplicate pairs.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    Ok Thanks for this.

    I have done all this and it is much better.

    I am a bit confused where i put the AmountPaid and DepositPaid Fields now though. It seems to me these still make sense in the Enrollments Table.

    Sorry

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    A deposit is still a payment toward the enrollment and should be in tblPayments.

    A total amount paid should be calculated when needed, not saved into table. So the AmountPaid field in tblPayments is for individual payments. Calculate a total of payments when needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    Thanks for your help

  11. #11
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    I am still struggling a bit.

    I want to be able to display the deposit whether or not it has been paid.

    ie i want a datasheet that displays the enrolment, and the deposit box so that i can put conditional formatting on it. (Red, Amber, Green Type thing)

    Now the payments have their own ID and i have no payments I am struggling to work out how to display it.

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    If a deposit isn't paid then it isn't a deposit. So if wasn't received, you want to show empty box? Could have a field in tblPayments to indicate category of payment (Deposit, OnBalance, etc). Then the form can have code that does a search on tblPayments to see if there is a deposit for the enrollment. An expression in textbox or query field using DLookup() function could do that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    I want to show amount paid £0.00 and the deposit either ticked or not.

    I am trying now to build a function in a query to collect all payments with the EnrollmentID_FK=toEnrollmentID as i think this would sort the TotalPaid field. A bit out of my depth though.


    The deposit paid is more of an indicator. I know it's odd but i want it tickable even if no payment is going in as the school has kids that they aren't going to expect a deposit from.
    This will let me indicate the RED people who havent paid and the people we arent really worried about.

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Okay, can have a yes/no field to indicate if this enrollment requires a deposit. Then an expression in another textbox can show the deposit amount if there is one in tblPayments.

    Have you even considered handling refunds or other types of credits? How much of an accounting system do you need to build?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Tommo is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    42
    Nah that will be unnecessary. No refunds or credit. They sign up and pay before the term start.

    I just need to show how much the class costs (ClassID - Term Cost)
    How much they have paid (sum of payments by enrollmentID_FK)
    and how much they owe.

    I think i am tired and struggling to work out how to get enrollments and payment data in to one datasheet or query so i can do all the formulas.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Payments Table and Form
    By Lou_Reed in forum Access
    Replies: 3
    Last Post: 04-14-2015, 03:03 PM
  2. Invoice and payments received
    By esther6086@lowcountry.com in forum Queries
    Replies: 1
    Last Post: 08-13-2013, 06:28 PM
  3. Need To Sum Payments in Query
    By burrina in forum Queries
    Replies: 3
    Last Post: 11-27-2012, 05:35 PM
  4. Replies: 3
    Last Post: 07-18-2011, 04:14 PM
  5. Your comments on this school database system please
    By crazycat503 in forum Database Design
    Replies: 3
    Last Post: 05-24-2011, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums