Use the FindControl() method of your Page/Control instance. This control
takes a string parameter that represents the ID of the control (the ID you
give like id="cboReport1" runat="server"). You get a base Control object if
it was found. Then you simply has to cast it to the right type (which you
should know which type it is), but ideally you would also verify that the
instance reference you got via FindControls() is of the type you expect.
Emil
"kentg" <ke***@villagesoft.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
How do I "build" the name of an ASP control in the VB Code behind? I
would like to cycle through several comboboxes using a loop.
(cboReport1, cboReport2, cboReport3, etc.)
ie. in MS-Access I can use the following code to reference a combobox
named cboReport6 and set it's value to 1:
strForm = MyForm
strControlName = "cboReport"
intCount = 6
Forms(strForm).Controls(strControlName & intCount).Value = 1
Thanks.