Calculate and Display an Average in a textbox

G

Guest

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!
 
G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top