Reputation: 3041
I am trying to retrieve value from a textbox dynamically.
This code isn't working.
For i = 1 To TotalSheets
ReqValue = ValidationForm.Frame6.ReportName(i).Value
Next
But this code does,
ReqValue = ValidationForm.Frame6.ReportName1.Value
I need to get the values dynamically through a loop.
Upvotes: 0
Views: 55
Reputation: 3053
Reportname(i) refers to an array.
Instead, you have to concatenate the name of your control:
ValidationForm.Frame6.Controls(“ReportName” & i).Value
Upvotes: 3