gillianleec
Technical User
I am trying to print the results of a query in a textbox on a report. There are 99 fields for each record that may or may not have data. The fields are named test_id1, test_id2 and so on through test_id99. I would like to build a Function that would loop through the fields and then concatenate them to a string.
Here is what I have so far but my programming experience is limited...
Function TEST(IntI As Integer)
Dim Line As String
DoCmd.SelectObject acQuery, "qryReport_IDreportable", True
For IntI = 10 To 99
Set Line = ("Test_id" & IntI)
TEST = TEST +", "& qryReport_IDReportable("Line"
Next
TEST = Left(TEST, Len(strText) - 2)
End Function
I get a "Can't execute code in design mode" error. Am I anywhere near??
Gillian
Here is what I have so far but my programming experience is limited...
Function TEST(IntI As Integer)
Dim Line As String
DoCmd.SelectObject acQuery, "qryReport_IDreportable", True
For IntI = 10 To 99
Set Line = ("Test_id" & IntI)
TEST = TEST +", "& qryReport_IDReportable("Line"
Next
TEST = Left(TEST, Len(strText) - 2)
End Function
I get a "Can't execute code in design mode" error. Am I anywhere near??
Gillian