I have many rows of text box pairs that need to display the result of a function call. There's more to it but the bottomline is I want to loop thru a collection and concatenate the text box names accordingly and display the result in the text box. I am stuck because sofar "Me.txtRprGrounds" is a String but how do I make Access understand it's a text box. Does anyone know the solution??
Dim txtRPR, txtMTN As String 'Or some other data type??
Dim coll As New Collection, var As Variant
coll.Add "Grounds"
coll.Add "Parking"
For Each var in coll
txtRPR = "Me.txtRpr" & var
txtMTN = "Me.txtMtn" & var
txtRPR = Cost(r)
txtMTN = Cost(m)
Next
Dim txtRPR, txtMTN As String 'Or some other data type??
Dim coll As New Collection, var As Variant
coll.Add "Grounds"
coll.Add "Parking"
For Each var in coll
txtRPR = "Me.txtRpr" & var
txtMTN = "Me.txtMtn" & var
txtRPR = Cost(r)
txtMTN = Cost(m)
Next