Results 1 to 7 of 7
  1. #1
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10

    Create a calculated field from sum of radio buttons

    I need to create a calculated field from radio buttons. I have been searching and have not found anything that addresses my particular situation. I need a calculated field that works like this:

    207 - (value of all 'no's)/ 207 * 100.

    The value of all 'no's will be a sum of all of the 'no's selected. Some 'no's are 6 points deductions, while others are 3 point deductions, etc.



    I created radio buttons for each question (48 total) with the option values of 'no' are set as the points (e.g. 6, 3, etc), which I've read to do. I have googled calculations from radio buttons and nothing looks quite like this. How should I proceed?

    Thank you!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    The radio buttons should have been bound to a field. (*yes, 0 no) = true in tTable.Q1
    This way you need only run a query to sum the values.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    As ranman says, save value to record.

    What is table structure?
    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.

  4. #4
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10
    I have attached a small mock up of what I currently have. I may have totally botched this.

    Thanks for the responses.

    Example.accdb

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    So the mockup table has 8 Completed fields. Do you want to count the False responses for each record?

    IIf([Task A Completed]=6,1,0) + IIf([Task B Completed]=3,1,0) + IIf([Task C Completed]=2,1,0) + IIf([Task D Completed]=6,1,0) + IIf([Task E Completed]=6,1,0) + IIf([Task F Completed]=6,1,0) + IIf([Task G Completed]=6,1,0) + IIf([Task J Completed]=6,1,0)

    Adding the values would be similar conditional expression. Replace the 1 with appropriate value.

    Now imagine doing that for 48 fields. Not only will that be tedious, the expression will likely exceed length limit.

    If you saved 0 for Yes and Null for N/A then addition calc could be:

    Nz([Task A Completed],0) + Nz([Task B Completed],0) + Nz([Task C Completed],0) + Nz([Task D Completed],0) + Nz([Task E Completed],0) + Nz([Task F Completed],0) + Nz([Task G Completed],0) + Nz([Task J Completed],0)

    However, same issues - tedious and too long.
    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.

  6. #6
    antimoneylaundering is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Posts
    10
    I do want to count responses for each record. I've come to terms with this being tedious, but if this is going to be too long how would you recommend I go about this? Is there any way to salvage what is built?

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Are you trying to build a questionnaire/survey database? This has been discussed in other threads. Search forum.

    Would require VBA code to do the counts and addition.

    Probably should scrap what you have and start over.

    http://www.rogersaccesslibrary.com/
    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.

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

Similar Threads

  1. Replies: 10
    Last Post: 06-10-2015, 08:16 AM
  2. Replies: 1
    Last Post: 11-30-2014, 12:31 PM
  3. Replies: 5
    Last Post: 04-04-2014, 03:33 PM
  4. Replies: 1
    Last Post: 05-09-2013, 07:54 PM
  5. Create a query With a Calculated Field
    By Content1 in forum Queries
    Replies: 2
    Last Post: 01-05-2013, 12:46 PM

Tags for this Thread

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