6StringJazzer: lRow is the last row in my table. tn is a number that Im matching in the table. The code runs on initialize. It was working fine until I added the j loop to dynamically change the textbox name that receives the value from the table.
Akuini: did not work.
My error says that it cannot find the specified object. The textboxes are within 2 frames. The first frame is "outerframe". Within outerframe I have 15 different frames, each of them have the 15 different textboxes that I want to update. I tried the below code, but same error. Do I need to reference both frames, or just the frame that the textbox is in? Thanks. -Luke
For i = 2 To lRow
For j = 1 To 15
If Range("BCO" & i) = tn Then
If Range("BCX" & i) = "" Then
Me("frame" & j).Controls("dest" & j).Value = Range("BCW" & i).Value 'frame1 is in outerframe, do i need to reference outerframe too?
Else
Me("frame" & j).Controls("dest" & j).Value = Range("BCX" & i).Value
End If
End If
Next j
Next i
Bookmarks