RE: iterate through set of controls in code behind on postback

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I did something like this

Private Sub seperateControls(ByVal Cntrl As Control)

If Cntrl.Controls.Count > 0 Then

Dim contrl As Control
For Each contrl In Cntrl.Controls

seperateControls(contrl)

Next

Else
'setTooltipValue(Cntrl)
End If

End Sub

--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------


"Oleg" wrote:

> Let's say I rendered a bunch of controls with the same name and different IDs.
> On postback, can I somehow iterate through these controls (checkboxes in
> this case, but could be dropdown controls in the future) and get their values
> and IDs
> with all this done in the code behind page?
> A small example would be appreciated.
> Thanks,
> Oleg
.



Relevant Pages

  • Re: XL-2003 - Class Module - Controls declared "withEvents" dont sink events..
    ... To answer your question, yes there will be more buttons, but there will also be other related controls used in the same class. ... My understanding is that the collection you suggest keeps the objBtn object in scope once the Initialize routine finishes. ... Private Sub UserForm_Initialize ... Dim objBtn As clsBtn ...
    (microsoft.public.excel.programming)
  • Re: XL-2003 - Class Module - Controls declared "withEvents" dont sink events..
    ... Private Sub UserForm_Initialize ... you dont have to "twist" you controls names to fit a given pattern ... The user can enter a date in the textbox, use arrow keys to change days, click on the button to pop the calendar control as he wish. ... But as I said before, if you don't want a control array, what is the purpose of the event sink class? ...
    (microsoft.public.excel.programming)
  • Re: Modeless userform OLEObject Add problem
    ... makes no difference running from an ActiveX button ... However no problem to add controls to any sheet EXCEPT ... > Private Sub UserForm_Activate ...
    (microsoft.public.excel.programming)
  • Re: go to a record in a form
    ... *unbound* controls, that simplifies things considerably. ... Private Sub isFindDups() ... ' put here the code to fill in the invisible txtboxdate ...
    (comp.databases.ms-access)
  • Re: Form Field Validation On The Fly
    ... Allen Browne - Microsoft MVP. ... You cannot use the events of the controls, ... >> Private Sub Form_BeforeUpdate ... >> only validation I require is that they are not empty. ...
    (microsoft.public.access.formscoding)