John,
I've a got working sample. Code:
Code:
Dim ctl As Object
For Each ctl In Me.Controls
If ctl.Tag = "lblcolor" Then
Me(ctl.Name).BackColor = 255
End If
Next ctl
Place this behind a button (..) on your form and all the labels tagged with 'lblcolor' are going red (255).
I wanted to attach a document, but I can't figure out how I can do that here (newby on this forum).
HTH
Willem: Thanks for helping. Here is the code I'm working with.
Private Sub cmdUnflagged_Click()
Dim startcolor As Long
Dim lbl As Object
startcolor = Me.BackColor
For Each lbl In Me.Controls
If lbl.Tag = "lblcolor" Then
Me.BackColor = RGB(255, 0, 0)
End If
Next lbl
MsgBox ("Please wait while the form is -processing")
Call macReconUnflagged
Me.BackColor = startcolor
For Each lbl In Me.Controls
If lbl.Tag = "lblcolor" Then
Me.BackColor = startcolor
End If
Next lbl
MsgBox ("Processing is complete you may continue")
Windows("AGFA DRAWBACK UTILITY.xls").Activate
End Sub
I tried to incorporate what you suggested. However, the form color changes too Red on the click command, but the labels remain at the startcolor. I tagged everything "lblcolor". What I'm I doing wrong?