Results 1 to 2 of 2
  1. #1
    02jwhitmore is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    1

    Question Payment Form - Return value in a text box depending on what you just picked from the combo box above

    Hi its a bit hard for me to explain but if anyone could point me in the right direction as to how to do this that would be truly grateful. So basically i have made a form with the following fields PaymentID, PaymentDate, StudentID, AmountPaidSoFar, PaymentAmount, NewBalance, FullyPaid. So the PaymentID and PaymentDate are made up automatically and so will the NewBalance and FullyPaid fields. My problem lies in the middle, I have created a combo box for selecting StudentID which is using results from a query. When the student has been picked the StudentID is viewed rather than their forename and surname. I now need the text box below (AmountPaidSoFar) to show the amount they have paid individually so it needs to have some sort of link with the value in the StudentID field and the query i guess but i could be wrong. This is what i need help with, what do i use for the text box to look up AmountPaidSoFar for that specific student? (The query I can link it to has the total amount they have paid so far and all the field names i have given you are as they are in my database, so any help or examples would be good thanks)

    Thanks in advance.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'm getting lost in your use of words. Perhaps a sample database would be in order with some garbage data in it.

    If the query driving your form is correct and is correctly giving you the numbers you want you can either use DLOOKUP (if you expect there to be 1 and only 1 value in your query) or DSUM (if you expect there to be more than 1 value in your query) using your STUDENTID field

    i.e.

    TOTALFIELD = dsum("[PaymentAmt]", "tblPayments", "[StudentID] = " & StudentComboBoxName)

    in the ON EXIT or ON CHANGE of the studentID picking combo box.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2014, 11:37 PM
  2. Replies: 5
    Last Post: 09-20-2012, 11:34 AM
  3. Replies: 5
    Last Post: 08-08-2012, 01:30 PM
  4. Replies: 4
    Last Post: 08-16-2011, 05:54 PM
  5. Return blank field depending on quantity
    By anthonyjf in forum Access
    Replies: 1
    Last Post: 04-01-2009, 08:22 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