Results 1 to 7 of 7
  1. #1
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62

    Help! How to achieved, Displays totals in a textbox from a data in a listbox.


    I working on my billing & collection section of my system and I want to display the sum/total amount of the consumer to a text box, by the way the listbox is depending on a textbox where i can search a name.
    please help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Don't know your data structure nor form design so hard to advise specifics. What data is in listbox? Can't sum on listbox items.
    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.

  3. #3
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    This is the visual sir.Click image for larger version. 

Name:	totals.jpg 
Views:	6 
Size:	237.8 KB 
ID:	35963

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    As I said, can't sum items in listbox, unless you want to write VBA code that loops through the listbox items.

    Could use a subform instead.
    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.

  5. #5
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Don't see why you can't do a DSum on the listbox rowsource query.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    If there is a query object, yes. But if the query is just SQL statement in the RowSource, no. Can DSum on the table with same filter criteria used for the listbox.

    So either build query object if there is not already one, or reference table directly.
    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.

  7. #7
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    I have used the dsum function sir, and it solved my problem, anyway thanks for the idea..

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

Similar Threads

  1. Replies: 1
    Last Post: 05-09-2018, 10:36 AM
  2. Replies: 6
    Last Post: 04-19-2015, 07:36 AM
  3. Replies: 8
    Last Post: 03-24-2015, 09:56 AM
  4. import all data from listbox to a textbox
    By mikael in forum Access
    Replies: 8
    Last Post: 09-09-2012, 07:16 PM
  5. Replies: 27
    Last Post: 08-14-2012, 09:05 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