N
new2access123 via AccessMonster.com
I have created a recordset that is a subset of records from another table
based on age and gender. Three of the columns in the recordset (among others)
are a Score, HighLimit and LowLimit. I need to determin if sngCurlUpCount:
- is greater than the largest value in the HighLimit
- or lower thant the lowest value in the HighLimit .
'This returns my recordset of 4 rows
Dim strSQL As String
'Query the look up table rows for the passed age and gender.
strSQL = "SELECT * " & _
"FROM MECurlUpTable " & _
"WHERE AgeLowLimit < " & [sngAge] & _
" And AgeHighLimit > " & [sngAge] & _
" And Male = " & [bytMale] & ";"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
When i execute this code i see that DMax(rs("HighLimit") and DMin(rs
("HighLimit") return the same value. But I know the high value in the
HighLimit column is 40 and teh low value is 13.
Debug.Print sngCurlUpCount
Debug.Print DMax(rs("HighLimit"), "MECurlUpTable")
Debug.Print DMin(rs("HighLimit"), "MECurlUpTable")
This is the code i wanted to use to return the correct score.
Select Case sngCurlUpCount
Case Is >= DMax(rs("HighLimit"), "MECurlUpTable")
varITAScoreCUC = 4
Case Is <= DMin(rs("HighLimit"), "MECurlUpTable")
varITAScoreCUC = 1
End Select
Should I be using something other than the domain functions or have I messed
up some where else?
Thanks for the help
based on age and gender. Three of the columns in the recordset (among others)
are a Score, HighLimit and LowLimit. I need to determin if sngCurlUpCount:
- is greater than the largest value in the HighLimit
- or lower thant the lowest value in the HighLimit .
'This returns my recordset of 4 rows
Dim strSQL As String
'Query the look up table rows for the passed age and gender.
strSQL = "SELECT * " & _
"FROM MECurlUpTable " & _
"WHERE AgeLowLimit < " & [sngAge] & _
" And AgeHighLimit > " & [sngAge] & _
" And Male = " & [bytMale] & ";"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
When i execute this code i see that DMax(rs("HighLimit") and DMin(rs
("HighLimit") return the same value. But I know the high value in the
HighLimit column is 40 and teh low value is 13.
Debug.Print sngCurlUpCount
Debug.Print DMax(rs("HighLimit"), "MECurlUpTable")
Debug.Print DMin(rs("HighLimit"), "MECurlUpTable")
This is the code i wanted to use to return the correct score.
Select Case sngCurlUpCount
Case Is >= DMax(rs("HighLimit"), "MECurlUpTable")
varITAScoreCUC = 4
Case Is <= DMin(rs("HighLimit"), "MECurlUpTable")
varITAScoreCUC = 1
End Select
Should I be using something other than the domain functions or have I messed
up some where else?
Thanks for the help