PC Review Forums Newsgroups Microsoft Access Microsoft Access VBA Modules Questionnaires-Scoring

Reply

Questionnaires-Scoring

 
Thread Tools Rate Thread
Old 01-07-2003, 06:48 AM   #1
Jake
Guest
 
Posts: n/a
Default Questionnaires-Scoring


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

  Reply With Quote
Old 02-07-2003, 11:53 PM   #2
Lee
Guest
 
Posts: n/a
Default Questionnaires-Scoring

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

>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off