I have two functions (one using the other) where I want to pass into it the
character A, B, C, D, or F and have it return a Double
indicating the minimum score it takes to get that grade. For example,
here's a stipped-down version of the first function:
private function getComment()
Select Case txtTotal ' the value in the text box txtTotal in the report
Case Is >= minimumScore(B)
getComment = "Good work!"
end select.
'etc.
end sub
Then here's the second function:
Private Function minimumScore(Gr adeLetter As String) as Double
Dim db As DAO.Database, rs As DAO.Recordset, StrSQL As String
StrSQL = "SELECT tblOptions.minG rade "
StrSQL = StrSQL & "FROM tblOptions "
StrSQL = StrSQL & "WHERE letterGrade = '" & GradeLetter & "'"
Set db = CurrentDb
Set rs = db.OpenRecordse t(StrSQL, dbOpenDynaset)
minimumScore = rs.Fields(0)
End Function
But it doesn't work. I'm trying to pass a string into the second function
(the letter grade) and have it return a double. (like 0.82, for example for
a B.) What am I forgetting?
Thanks.
Rich Hollenbeck
character A, B, C, D, or F and have it return a Double
indicating the minimum score it takes to get that grade. For example,
here's a stipped-down version of the first function:
private function getComment()
Select Case txtTotal ' the value in the text box txtTotal in the report
Case Is >= minimumScore(B)
getComment = "Good work!"
end select.
'etc.
end sub
Then here's the second function:
Private Function minimumScore(Gr adeLetter As String) as Double
Dim db As DAO.Database, rs As DAO.Recordset, StrSQL As String
StrSQL = "SELECT tblOptions.minG rade "
StrSQL = StrSQL & "FROM tblOptions "
StrSQL = StrSQL & "WHERE letterGrade = '" & GradeLetter & "'"
Set db = CurrentDb
Set rs = db.OpenRecordse t(StrSQL, dbOpenDynaset)
minimumScore = rs.Fields(0)
End Function
But it doesn't work. I'm trying to pass a string into the second function
(the letter grade) and have it return a double. (like 0.82, for example for
a B.) What am I forgetting?
Thanks.
Rich Hollenbeck
Comment