Results 1 to 5 of 5
  1. #1
    SgtSaunders69 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    17

    Calculating sum of selected option/combo boxes

    I have a survey form which collects information from a series of 20 or so option boxes. Each option boxes is set up to provide an integer (1 or 2 or 7 or 134....) as the result of user selection of one of the provided options in the particular box. I want to create a text box in the header of the form which will as the field in each option box is selected take the number related to that selection and display a running sum of all currently selected option boxes on the current record. Any thoughts on how to go about this would be greatly appreciated...!



    Thanks...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What do you mean by option boxes - a combobox? Each box is bound to a field? You will have to build an expression in textbox ControlSource that adds the boxes: a + b + c + ... with a, b, c representing the field/combobox names.
    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
    CTdbdev is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2014
    Posts
    12
    I'm trying to do something similar here, but how should the expression be formatted in the textbox controlsource so it actually does arithmatic?

    Code:
    =([Combo233].[Column](2)+[Combo237].[Column](2))
    With the above expression, the texbox just literally lists both price values, i.e. (0.12.25)

    Regards,
    Alex

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Looks like your expression is not pulling the value of the combobox but content of column that is not the bound column.

    Wrap at least one of the terms in Val() function.
    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
    CTdbdev is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2014
    Posts
    12
    Ok. I understand that now. Thank you!

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

Similar Threads

  1. Replies: 5
    Last Post: 11-21-2011, 09:59 PM
  2. Visible text boxes when combo box choice selected
    By nichmeg in forum Programming
    Replies: 3
    Last Post: 10-16-2011, 02:53 PM
  3. How too use check boxes and option buttons
    By newtoAccess in forum Forms
    Replies: 0
    Last Post: 12-03-2010, 04:41 PM
  4. Replies: 1
    Last Post: 11-23-2010, 01:30 PM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 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