A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form data entry



 
 
Thread Tools Display Modes
  #1  
Old November 2nd, 2009, 09:50 PM posted to microsoft.public.access.forms
shangman via AccessMonster.com
external usenet poster
 
Posts: 10
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.