Toggling visibility of boxes

  • Thread starter pwdpwd via AccessMonster.com
  • Start date
P

pwdpwd via AccessMonster.com

Hi - Hope that someone can help; I need to toggle the visibility of some
boxes in a Report Header, dependant on the number of characters in the length
of the field name in the report header.

The boxes form the vertical 'lines' in the header - easier to position than
lines, as the boxes are the same dimensions as the fields in the detail of
the report. As the boxes share the same vertical boundary (the right side of
box 1 is the same as the left side of box 2 etc) and as there is a line at
the top and bottom of the header, toggling the visibility of 1 box means that
I only affect the left side of the box - which is great.

I'm using a monospaced font, so I have calculated when the visibility should
be toggled. I've got the code to work partially, but I know that I'm doing
something wrong - as well as probably going about it totally the wrong way!

The code that I'm using (for the 1st 2 boxes) is:

' One box - characters 15 & 16
If (Len(Me.OwnerName) > 14 And Len(Me.OwnerName < 17)) Then
Me.Box362.Visible = False
End If
' 2 boxes - characters 17, 18 & 19
If (Len(Me.OwnerName) > 16 And Len(Me.OwnerName < 20)) Then
Me.Box362.Visible = False
Me.Box363.Visible = False
End If

and etcetera for 12 boxes!

The effect that I get, is that for each of the headers on the report, the
code does not check for visibility for each of the headers; visibility
mirrors the previous row, so that after a few pages, all the visibilities are
set to the maximum.
 

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