If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
For-Each-Next for Specific Object Type
I have a form with several objects on it. I want to create a For-Each-
Next loop to gather information, but only for objects of LABEL type. My current approach is to go through the entire collection, put an IF statement between the EACH and NEXT of my loop to determine the control type, and if it is a LABEL, continue processing (if not, move on to the next control). My only problem is - how can I determine the type of the control inside of the loop? Thanks for any help! |
#2
|
|||
|
|||
For-Each-Next for Specific Object Type
For Each ctl In Me.Controls
If TypeOf ctl Is Label Then .... End If Next ctl -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "jtertin" wrote in message ... I have a form with several objects on it. I want to create a For-Each- Next loop to gather information, but only for objects of LABEL type. My current approach is to go through the entire collection, put an IF statement between the EACH and NEXT of my loop to determine the control type, and if it is a LABEL, continue processing (if not, move on to the next control). My only problem is - how can I determine the type of the control inside of the loop? Thanks for any help! |
#3
|
|||
|
|||
For-Each-Next for Specific Object Type
Thanks!!!
Is there a way to perform a similar For-Each operation for each column of the form's Record Source? i.e.: For Each column In Me.RecordSource If column.Name = "TestString" Then .... End If Next column |
#4
|
|||
|
|||
For-Each-Next for Specific Object Type
Dim fld As DAO.Field
For Each fld In Me.RecordsetClone.Fields If fld.Name = "TestString" Then End If Next fld -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "jtertin" wrote in message ... Thanks!!! Is there a way to perform a similar For-Each operation for each column of the form's Record Source? i.e.: For Each column In Me.RecordSource If column.Name = "TestString" Then ... End If Next column |
Thread Tools | |
Display Modes | |
|
|