If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Form data entry
I have a form where personnel enter scores for an audit. There are 5 sections
to the audit. As they score each question in the section it gives a total overall average for each section. For example section 1 has 6 questions labeled wk1, wk2, wk3, wk4, wk5 wk6. (each are a text box) They would enter a score of 0 - 5. Each section scores this way. Some sections have more or less entries. Also after then audit is complete i have it calculate an overall ave from all 5 sections. This is all working fine. What i would like to happen is, if section 1 overall ave of 4, then when they score answers in (lets say) section 5, the scores for each question cannot be 4, or if section 1 overall ave is 3, the score entry for section 5 questions cannot be 3, and so on. I dont know where or really how to write the code for this. Would this be an "if" statement for each textbox say in section 5. here is an example of what i use for the first section: Public Sub findave() totval = 0 wkcount = 0 Dim flist As Variant flist = Array(Me.wk1, Me.wk2, Me.wk3, Me.wk4, Me.wk5, Me.wk6) For Each x In flist If x.Value -1 Then totval = totval + x.Value wkcount = wkcount + 1 End If Next x If wkcount -1 Then tempval = totval / wkcount overall.Value = totval / wkcount End If End Sub This in put in "after update" for textbox wk1 Private Sub wk1_AfterUpdate() Call findave End Sub -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200911/1 |
Thread Tools | |
Display Modes | |
|
|