G
Greg Green
I'm writing a loop that composes an SQL String along the way. The result of
the SQL String is passed into a control. With each pass of the loop, I'd
like to generate a control name that I can pass the result of the SQL String
into. I have this and it's hanging
--------------------------
Do Until strLoopCount = 2
strLoopCount = strLoopCount + 1
strHourEnd = strLoopCount & ":00"
strSQL = "SELECT tblValues.Value FROM tblValues WHERE
(((tblValues.Date)=#" & strRefDate & "#) AND ((tblValues.PointID)=1007) AND
((tblValues.HrEnd)='" & strHourEnd & "'));"
rst.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Dim ctl As Control, frm As Form
Set frm = Me
Set ctl = "A" & strLoopCount <----- code breaks on
this line "type mismatch"
frm.ctl.Value = rst("Value")
Loop
--------------------------
What would do the trick?
Thanks - G
the SQL String is passed into a control. With each pass of the loop, I'd
like to generate a control name that I can pass the result of the SQL String
into. I have this and it's hanging
--------------------------
Do Until strLoopCount = 2
strLoopCount = strLoopCount + 1
strHourEnd = strLoopCount & ":00"
strSQL = "SELECT tblValues.Value FROM tblValues WHERE
(((tblValues.Date)=#" & strRefDate & "#) AND ((tblValues.PointID)=1007) AND
((tblValues.HrEnd)='" & strHourEnd & "'));"
rst.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Dim ctl As Control, frm As Form
Set frm = Me
Set ctl = "A" & strLoopCount <----- code breaks on
this line "type mismatch"
frm.ctl.Value = rst("Value")
Loop
--------------------------
What would do the trick?
Thanks - G