Results 1 to 11 of 11
  1. #1
    Akirien is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7

    Question About Sum In Next Record In A Form

    Hello there,

    I have a form. This form contains 5 fields (Subtotal) for a certain record. I can calculate the sum of the 5 fields value in the field Total, for first record, but when I click for next record, the Total value remains unchanged (same like first record).



    Please help me. Thank you..

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Is total a Field or an unbound text box. What is the record source of the form. have you used any code to calculate the total if yes where is the code attached to which event and control. Please let me know.

  3. #3
    Akirien is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7
    It is a field... At Total textbox properties, I chose Control Source, and the Expression Builder appeared.. I put this code in the area :

    =SUM([subTotal1]+[subTotal2]+[subTotal3]+[subTotal4]+[subTotal5])

    it only calculates first record in the form..

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Type this code in the control source and see if it works.

    =[subTotal1]+[subTotal2]+[subTotal3]+[subTotal4]+[subTotal5]

  5. #5
    Akirien is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7
    Hi.. thank you Maximus.. It worked.. But I need to save it first, and close it. Open it back, the value will change. If not, it will remain unchanged or no value there.. Let's say I have 5 field, <5 is filled, the Total value is null.. In other words, I also need to fill all (5) fields.

  6. #6
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    can you do something covert the database to access 2000 and send it to me I will do the needful.
    Thanx

  7. #7
    Akirien is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7
    It's in other language. But if you don't mind, here's the link : Download Here

    The form named FALL is what I mean.
    Text55 is Total. Jumlah(Hari), Jumlah(Hari)1, and so on, are the sub-total.. Thank you for helping..

  8. #8
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    I have made some alterations attachments in this forum is permitted to 2 mb as Zip and thus I had to remove the pictures that you had added in the background of your forms. I have made some modifications to the Fall form.

    Result:
    1) Total will appear even if one of the field is blank.
    2) Total is updated as soon you make an entry in one of the field and move to another.

    Codes modified:

    =IIf(IsNull([JUMLAHHARI]),0,[JUMLAHHARI])+IIf(IsNull([JUMLAHHARI1]),0,[JUMLAHHARI1])+IIf(IsNull([JUMLAHHARI2]),0,[JUMLAHHARI2])+IIf(IsNull([JUMLAHHARI3]),0,[JUMLAHHARI3])+IIf(IsNull([JUMLAHHARI5]),0,[JUMLAHHARI5])


    Docmd.Requery "Text55" added to the after event of JUMLAHHARI to JUMLAHHARI5

    if this solves your problem mark this thread solved.

    Find attached mdb (zipped)

  9. #9
    Akirien is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7
    Thank you very much Maximus.. You're really a wizard.. Really appreciate it..

  10. #10
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Glad I could help. The forms that You have created are the most beautiful decorated ones that I have ever seen. If you don't mind can tell me the language that you used.

  11. #11
    Akirien is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7
    It's Malay languange.. I'm Malaysian.. Thank you again..

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

Similar Threads

  1. Question about Form
    By ACM in forum Programming
    Replies: 3
    Last Post: 10-09-2009, 04:25 PM
  2. Replies: 3
    Last Post: 06-27-2009, 03:53 PM
  3. Replies: 9
    Last Post: 03-24-2009, 09:19 PM
  4. Replies: 1
    Last Post: 02-02-2009, 05:52 AM
  5. Replies: 0
    Last Post: 11-10-2008, 12:32 PM

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