Access Reports (how do I set existing control backcolor)

R

Rockster

I tried in the on open event using
Dim ThisControl As Contro
For Each ThisControl In Control
If ThisControl.Properties("tag") = 1 The
ThisControl.Properties("backcolor") = 6553
End I
Nex

It executes the code, but the controls still remain at preset color
HELP!
 
A

Allen Browne

The Tag property is a string. Try:

For Each ThisControl in Me.Controls
If ThisControl.Tag = "1" Then
ThisControl.BackColor = vbYellow
End If
Next

Note that some controls may not have a BackColor.
 
R

Rockster

In debug, the tag property was selecting the correct controls (lablel, or textbox). I did use VbYellow instead of the integer value, but still not setting the backcolor, but is stepping through to line setting it.
 
R

Rockster

The tag test is returning the correct label/textbox controls..
I did change to use VbYellow rather than the integer yellow value, but still fails
Debug does execute the appropriate line setting backcolor, but when previewed, it does not display it

----- Allen Browne wrote: ----

The Tag property is a string. Try

For Each ThisControl in Me.Control
If ThisControl.Tag = "1" The
ThisControl.BackColor = vbYello
End I
Nex

Note that some controls may not have a BackColor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top