Concatanation

  • Thread starter Thread starter PeterM
  • Start date Start date
P

PeterM

I have a tab control on a form. The tab control has 15
tabs (pages). Each of the 15 pages has an ActiveX Web
Browser object on it each entitled ActiveXctlnn where nn
is a two digit number correstponding to the tab number.
In other words, tab 12 has the browser object called
ActiveXctl12 on it.

I need to develop code that can cycle through each of the
15 objects performing the same function.

Me.ActiveXctl00.Navigate "URL"
Me.ActiveXctl01.Navigate "URL"
Me.ActiveXctl02.Navigate "URL"
Me.ActiveXctl03.Navigate "URL"

is what I have now. Is there a way to make the nn a
variable and write

Me.ActiveXctl(variable).Navigate "URL"

Any help is appreciated.
 
PeterM said:
I have a tab control on a form. The tab control has 15
tabs (pages). Each of the 15 pages has an ActiveX Web
Browser object on it each entitled ActiveXctlnn where nn
is a two digit number correstponding to the tab number.
In other words, tab 12 has the browser object called
ActiveXctl12 on it.

I need to develop code that can cycle through each of the
15 objects performing the same function.

Me.ActiveXctl00.Navigate "URL"
Me.ActiveXctl01.Navigate "URL"
Me.ActiveXctl02.Navigate "URL"
Me.ActiveXctl03.Navigate "URL"

is what I have now. Is there a way to make the nn a
variable and write

Me.ActiveXctl(variable).Navigate "URL"

Any help is appreciated.

Dim intTabNo As Integer
Dim strCtlName As String

For intTabNo = 0 to 14
strCtlName = "ActiveXctl" & Format(intTabNo, "00")
Me.Controls(strCtlName).Navigate "URL"
Next intTabNo
 
-----Original Message-----


Dim intTabNo As Integer
Dim strCtlName As String

For intTabNo = 0 to 14
strCtlName = "ActiveXctl" & Format (intTabNo, "00")
Me.Controls(strCtlName).Navigate "URL"
Next intTabNo

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
THANK YOU!
 
Back
Top