Bryan Schmidt
asked on
Moving a control to front or back in an Access 2003 report using VBA
I have some rectangles in an Access 2003 report that expand or contract based upon values in certain fields. The rectangles are essentially "stacked" upon one another so the shorter ones are not covered up by those which are longer. This process works well but occassionally the smaller ones have values that exceed the next size and thus cover up those that are usually longer. The rectangles display in color which requires the back style property to be normal. Thus, setting the back style property to transparent is not an option.
I think the solution is to add code to send the short rectangle control to the front or back depending on its length relative to other fields. What I don't know is the syntax needed to accomplish this. I'm guessing it would be similar to the following.
If Me. Box1.value > Me.Box2.value then
Me. Box1.SEND TO BACK
Else
Me.Box1.SEND TO FRONT
End if
I would appreciate any suggestions on how to do this, or if another approach would be better.
I think the solution is to add code to send the short rectangle control to the front or back depending on its length relative to other fields. What I don't know is the syntax needed to accomplish this. I'm guessing it would be similar to the following.
If Me. Box1.value > Me.Box2.value then
Me. Box1.SEND TO BACK
Else
Me.Box1.SEND TO FRONT
End if
I would appreciate any suggestions on how to do this, or if another approach would be better.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, but the problem is not changing the size, but the fact that changing the size ruines the layout they've setup, which is a "stacked" series of rectangles.
They need to change the z layout order.
I wonder though if all the rectangles could be drawn in order in the OnPage event?
A thought...
Jim.
They need to change the z layout order.
I wonder though if all the rectangles could be drawn in order in the OnPage event?
A thought...
Jim.
ASKER
For now I will accept the response of capricorn1 and Jim Dettman. I can live with what I have and recognize the issue is essentially a limitation within Access. Jim's second comment suggests a possible alternative to consider but time constraints prevent me from exploring it. I appreciate everyone's quick response. I will keep the comments from the HiTechCoach for future reference.
see: http://lebans.com/PrintLines.htm