Moving a control to front or back in an Access 2003 report using VBA
Posted on 2013-11-13
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
Me.Box1.SEND TO FRONT
I would appreciate any suggestions on how to do this, or if another approach would be better.