I want to do a For each loop on a column of textboxes on a report.
The number of boxes (rows) is not constant so I was hoping to achieve something like this:
It's the red text I'm not sure about. Is it possible?
Hopefully it will be calculating workedHours() using the value in each row of the staffPIN column and the name of the column 'columnName'. (ie same 'columnName' each time but different values for StaffPIN corresponding to each row of my report)
Phew, hope that makes sense
It's trying to solve a problem I posted on a thread here.
The number of boxes (rows) is not constant so I was hoping to achieve something like this:
Code:
Public Function SumCalculatedColumn(columnName As String)
Dim ctl As Control
Dim rpt As String
Dim runningTotal As Int
rpt = "[Reports]![Service Schedule Report]"
[COLOR="red"]For Each ctl In rpt.[StaffPIN] [/COLOR] 'Where [StaffPIN] is the name of a column in my report
[COLOR="red"]runningTotal = runningTotal + workedHours(ctl, rpt.columnName)
Next ctl[/COLOR]
SumCalculatedColumn = runningTotal
It's the red text I'm not sure about. Is it possible?
Hopefully it will be calculating workedHours() using the value in each row of the staffPIN column and the name of the column 'columnName'. (ie same 'columnName' each time but different values for StaffPIN corresponding to each row of my report)
Phew, hope that makes sense

It's trying to solve a problem I posted on a thread here.