I have a form with a MultiPage control. There are 11 pages, and one Textbox
on each page. The Tag property of each Textbox has been set to correspond
to a certain Custom Document Variable. On Form_Initialize, I would like to
loop through all the text boxes, read the tag, and retrieve the
corresponding variable value to display in the text box.
I have
Dim mp As Multipage
Dim str As String
Dim tbx As TextBox
Here I can't get the right object to get the Tag property. I tried:
For Each tbx In Me.Controls
For Each tbx In mp.Pages
and a few other combinations I don't recall, but when I type
str= tbx. ''' I can never get the AutoText to show the Tag property
for whatever object tbx has become.
Can someone help me out, please?
Ed
Ed - 13 Oct 2005 23:58 GMT
Never mind. I found a solution.
For Each ctl In Me.Controls
strName = ctl.Name
If Left(strName, 7) = "TextBox" Then
strTag = ctl.Tag
On Error Resume Next
strVar = doc.Variables(strTag).Value
On Error GoTo 0
Me.Controls(strName).Text = strVar
End If
Next ctl
> I have a form with a MultiPage control. There are 11 pages, and one Textbox
> on each page. The Tag property of each Textbox has been set to correspond
[quoted text clipped - 17 lines]
>
> Ed