PC Review
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Questionnaires-Scoring
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Questionnaires-Scoring
![]() |
Questionnaires-Scoring |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Lee,
For this I'd go with a select case for the gender, then nest an if statement for the age. Function AgeGenderScore(Age as Integer, Gender as Integer) as Integer Select Case Gender Case 0 'Male If Age >=45 and Age < 50 Then AgeGenderScore = 5 ElseIf Age >=50 and Age < 55 AgeGenderScore = 6 ElseIf '... End If Case 1 'Female If Age >=45 and Age < 50 Then AgeGenderScore = 2 ElseIf '... End If End Select End Function Where you fill in the rest of the values under the "ElseIf"'s. HTH Jake >-----Original Message----- > >I am scoring questions from a questionnaire. I am having >problems with scoring the questions. > >this questionnaire scores differently for Male and >Female.Their is aprox. 4 other variables that decide a >total score. > >I will give example using two variables >For example: >if female and age is between 45-49 they score a 2 >if female and age is between 50-54 they score a 3 >if female and age is between 55-59 they score a 4 > >if male and age is between 45-49 they score a 5 >if male and age is between 50-54 they score a 6 >if male and age is between 55-59 they score a 7 > >I have a field called gender and it is coded as male=0 >and female =1.(so when I look at my fields it show a 0 or >a 1 instead of male or female. > >Someone helped me a couple of weeks ago with an age >module but I forgot about male and females score >differently. Thanks > >. > |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Thanks Jake
>-----Original Message----- >Lee, > >For this I'd go with a select case for the gender, then >nest an if statement for the age. > >Function AgeGenderScore(Age as Integer, Gender as Integer) >as Integer > >Select Case Gender > Case 0 'Male > If Age >=45 and Age < 50 Then > AgeGenderScore = 5 > ElseIf Age >=50 and Age < 55 > AgeGenderScore = 6 > ElseIf '... > End If > > Case 1 'Female > If Age >=45 and Age < 50 Then > AgeGenderScore = 2 > ElseIf '... > End If >End Select >End Function > >Where you fill in the rest of the values under >the "ElseIf"'s. > >HTH > >Jake > > > >>-----Original Message----- >> >>I am scoring questions from a questionnaire. I am having >>problems with scoring the questions. >> >>this questionnaire scores differently for Male and >>Female.Their is aprox. 4 other variables that decide a >>total score. >> >>I will give example using two variables >>For example: >>if female and age is between 45-49 they score a 2 >>if female and age is between 50-54 they score a 3 >>if female and age is between 55-59 they score a 4 >> >>if male and age is between 45-49 they score a 5 >>if male and age is between 50-54 they score a 6 >>if male and age is between 55-59 they score a 7 >> >>I have a field called gender and it is coded as male=0 >>and female =1.(so when I look at my fields it show a 0 or >>a 1 instead of male or female. >> >>Someone helped me a couple of weeks ago with an age >>module but I forgot about male and females score >>differently. Thanks >> >>. >> >. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

