J
James
Im trying to give a textbox in a userform an initial value. Its not straight
forward because the name of the textbox is not always the same (dynamic
userform). I've setup this loop but cant get oCont.Value to work. Does anyone
know why? Any Help is much appreciated. Thanks in advance
Dim oPage As Page, oCont As control
For Each oPage In DataPlate.MultiPage1.Pages
If oPage.Index >= 3 Then Exit For
For Each oCont In oPage.Controls
If TypeName(oCont) = "TextBox" Then
If InStr(1, oCont.Tag, "PD") > 0 Then
'SOMEHOW SET THE VALUE OF THE TEXTBOX HERE
ElseIf InStr(1, oCont.Tag, "Proj") > 0 Then
'SOMEHOW SET THE VALUE OF THE TEXTBOX HERE
End If
End If
Next oCont
Next oPage
forward because the name of the textbox is not always the same (dynamic
userform). I've setup this loop but cant get oCont.Value to work. Does anyone
know why? Any Help is much appreciated. Thanks in advance
Dim oPage As Page, oCont As control
For Each oPage In DataPlate.MultiPage1.Pages
If oPage.Index >= 3 Then Exit For
For Each oCont In oPage.Controls
If TypeName(oCont) = "TextBox" Then
If InStr(1, oCont.Tag, "PD") > 0 Then
'SOMEHOW SET THE VALUE OF THE TEXTBOX HERE
ElseIf InStr(1, oCont.Tag, "Proj") > 0 Then
'SOMEHOW SET THE VALUE OF THE TEXTBOX HERE
End If
End If
Next oCont
Next oPage