populate and update textbox

D

deb

I am working on a scorecard form. I need a total text box for the top and
botton of the subform(called f004PMScore).

Within the subform are 12 rows of 5 buttons. when a button in the first row
is clicked the Cat1Score textbox is populated with the corresponding score.

Buttons are named ScoringCriteria1 thru ScoringCriteria60.

There are 12 textboxes for the 12 rows. called Cat1Score, Cat2Score and so
on, up to Cat12Score. The textboxes are blank until one of the row buttons
are clicked.

I need the text box at the top of a subform called TTLScore2 and one at the
bottom called TTLScore1 to show the total of the ScoringCriteria1 thru
ScoringCriteria12 and to updated when one of the 12 text box score is changed.


What is the best way to populate and update TTLScore1 and TTLScore2
textboxes?

Thanks in advance,
 
K

Klatuu

You can write a function that will update TTLScore1 and TTLScore2 by adding
the values of ScoringCriteria1 thru ScoringCriteria12 whenever any of the
buttons is pushed.

To cause it to excute for each button, execute the function in the After
Update event of each button.

Function UpdateTotals() As Boolean
With Me
.TTLScore1 = Nz(.ScoringCritera1, 0) _
+ Nz(.ScoringCritera2, 0) _
+ Nz(.ScoringCritera3, 0) _
+ Nz(.ScoringCritera4, 0) _
+ Nz(.ScoringCritera5, 0) _
+ Nz(.ScoringCritera6, 0) _
+ Nz(.ScoringCritera7, 0) _
+ Nz(.ScoringCritera8, 0) _
+ Nz(.ScoringCritera9, 0) _
+ Nz(.ScoringCritera10, 0) _
+ Nz(.ScoringCritera11, 0) _
+ Nz(.ScoringCritera12, 0) _
.TTLScore2 = .TTLScore1
End With
End Function
 

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