I am putting a recordset values into a string, but I am having a little trouble storing the highest value into a variable. The type of rs1.Fields(0).Value is Variant/Double.
I thought I could do something like:
Dim Highval
if highval < rs1.Fields(0).Value then
highval = rs1.Fields(0).Value
end if (... putting this portion inside the loop)
However, I am having trouble picking the right variable type... (is it double?)
I am also having trouble intializing the variable... (do I need to somehow allocate space for this variable?)
I am having trouble performing the comparision... (once I get the first two problems fixed.. the if statement should work right?)
I thought I could do something like:
Dim Highval
if highval < rs1.Fields(0).Value then
highval = rs1.Fields(0).Value
end if (... putting this portion inside the loop)
However, I am having trouble picking the right variable type... (is it double?)
I am also having trouble intializing the variable... (do I need to somehow allocate space for this variable?)
I am having trouble performing the comparision... (once I get the first two problems fixed.. the if statement should work right?)
Code:
Dim rs1 As Recordset
Dim frm As Access.Form
Dim values1 As String
Set rs1 = frm.Recordset
If rs1.RecordCount > 0 Then
rs1.MoveFirst
trendlineCtr = 0
Do While Not rs1.EOF
values1 = values1 & (rs1.Fields(0).Value) & Chr(9)
rs1.MoveNext
trendlineCtr = trendlineCtr + 1
Loop
rs1.Close
Set rs1 = Nothing
[\code]