Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / August 2007

Tip: Looking for answers? Try searching our database.

Calculate and Display an Average in a textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wx_chase - 03 Aug 2007 22:20 GMT
I'm trying to create a form with 5 rows of check box's and then pass the
assigned value ( based on users input choice) to a text box.

Looks sort of like this with numbered rows.

#1        #2        #3       #4        #5
*A=5   * A=5    *A=5   *A=5    *A=5
*B=4   *B=4     *B=4    *B=4    *B=4
*C=3   *C=3    *C=3    *C=3    *C=3
*D=2   *D=2    *D=2    *D=2    *D=2
*E=1   *E=1     *E=1    *E=1    *E=1

TEXTBOX=Average of selected checked box's  (always one check per row)

1. First, how do I assign the values shown above to each check box?
2. Then, How do I calculate and display the average of a users selection
into my text box? (sum/5?)
3. Once the box's are checked, and the average obtained, can I pass all
those parameters to my table with a save button?   (selected checkbox's and
the average)

Thanks!
wx_chase - 06 Aug 2007 20:08 GMT
OK, I was able to use an option group instead of checkbox's to assign values
to each choice, and update my table with the values assigned.  But I'm still
stuck on how to make the txaverage textbox on my form calculate, and display
the average of the selected choices.

> I'm trying to create a form with 5 rows of check box's and then pass the
> assigned value ( based on users input choice) to a text box.
[quoted text clipped - 18 lines]
>
> Thanks!
wx_chase - 07 Aug 2007 18:56 GMT
I think I may have put this question in a forum less traveled judging by the
lack of responses....anyhow I figured it out in case anyone else runs into
this.

I am able to get my txAverage textbox to display the average of all the
option group choices by adding a simple code to the fifth (last) frame to
calculate the average

Private Sub Frame5_AfterUpdate()
Me.txAverage = [Frame1] + [Frame2] + [Frame3] + [Frame4] + [Frame5] / 5
End Sub

There might be an easier way of doing this, but being the novice that I am,
this is the only solution I could come up with after much trial and error.  
Obviously user input is required in all frames for the formula to work, but
in my particular case all 5 choices are required, thus the final choice
calculates the average in my textbox.

If anyone has a more efficient solution for doing this on a bound textbox I
am all ears.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.