Results 1 to 6 of 6

Thread: HELP!!!

  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HELP!!!

    I'm trying to combine a bunch of tables that show all account activity (invoices, payments, withdrawals, etc.). It is a database that keeps track of students school fees. The problem is that on the invoice I have several lines because they have several different fees to pay. But when I try to show a payment, it doubles it up. On the invoice screen there is a payment button that you click on to go to payments and enter the invoice that it is paying which in some cases might be only partial payment.

    So I had an Elementary fee for $35 and a Student Council fee for $5, then the student made a payment of $30. But when I try to put them together, it puts the $30 payment on each invoice line, so it comes out as a $60 total payment.

    I need HELP!!! <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HELP!!!

    if you will post the code we might can help

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HELP!!!

    Okay...I'll explain what's going on. I have a student form that shows the student's name, parents, address. On that form I have a button that opens an Invoices form. On that form I have a button that opens a Payments form, and a button that opens a Withdrew form. Now...

    I made a button that opens an Account form. That form I made from a query that queries all the tables together. When you look at what info the query pulls, it shows each line of the invoice with the SAME $30 payment next to it. I want the program to tell that there was only one payment and not list it on each line of the query. How do I do that? Am I missing a step?

    I hope you can tell what I'm trying to explain. I don't really have any code to show you because it is the query where I think the problem is.

    Jennifer

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HELP!!!

    A good place to start looking is your table relationships.

    If you do not have the relationships between tables properly defined, that might give you that repeat value of $30 for each entry. The first thing to note is how many records that query generates. If the number seems ludicrous you more than likely have those set incorrectly.

    jazguessin'
    <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  5. #5
    ScoobyDoo!
    Guest

    Re: HELP!!!

    Okay, I don't have a complete solution for you, but I think I understand what is happening, and I think I can point you in the correct direction. Let me ask you a couple questions real quick, though to verify that I have the picture. Do you have a seperate table for payments and for invoices/invoice items? Or are you trying to apply the payment to the invoice table?

    If you do not have a seperate payment table, then I think the solution seems simple. Create one. Then you don't have to try to determine which invoice item, in a case where a student has more than one, on a particular invoicea a payment belongs to. You can just calculate the total of the invoice less payments made to that invoice.

    If you do have a seperate table for invoices and payments, then it sounds to me like there is an error in the relationships between the tables, causing there to be the same payment applied to all items on an invoice.

    Hope this helps.

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HELP!!!

    I have a separate table for payments. I have a Student table, Invoice table, Invoice Detail table, and a payment table. I have joined the Payment table to the Invoice table by way of One-to-many (Invoice table to Payment table). Is this maybe the problem?

    Jen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •