Full Version: Looping through Tags on Form
UtterAccess Forums > MicrosoftŪ Access > Access Forms
dabomb311
I have done this before i just cant figure it out again..
That i want to do is say that every textbox that has a tag of "edit" , i want to change it to yellow.
loop through all the tags on teh form
aelkron
This might help...
Declare Constants
Const csEdit = "Edit"
Const ciYellow = 8454143

' Declare Objects
Dim ctlCurrent As Control

For Each ctlCurrent In Me.Controls
Debug.Print ctlCurrent.Name
If Nz(ctlCurrent.Tag) = csEdit Then
ctlCurrent.BackColor = ciYellow
End If
Next ctlCurrent
dabomb311
Object doesn't support this proprty or method. Run Time Error 438
dabomb311
sorry.. missed typed something. works good.. thanks
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.