Top property greater than 32767

P

Paul Luxton

I am creating boxes using line so that the box around a label matches up with
an expanding (Can Grow = Yes) text box :-
'PCTNoRationaleLabel
lngHeight = Me.PCTNoRationale.Height
Me.Line (Me.PCTNoRationaleLabel.Left, Me.PCTNoRationaleLabel.Top) _
-Step(Me.PCTNoRationaleLabel.Width, lngHeight), , B

I have a problem as Me.PCTNoRationaleLabel.Top is greater than the maximum
for an integer. The report is printing all of the controls fine, but I am
unable to get at the actual value of Me.PCTNoRationaleLabel.Top to create the
box as it is only given to me as an integer. What can I do?
 
M

Marshall Barton

Paul said:
I am creating boxes using line so that the box around a label matches up with
an expanding (Can Grow = Yes) text box :-
'PCTNoRationaleLabel
lngHeight = Me.PCTNoRationale.Height
Me.Line (Me.PCTNoRationaleLabel.Left, Me.PCTNoRationaleLabel.Top) _
-Step(Me.PCTNoRationaleLabel.Width, lngHeight), , B

I have a problem as Me.PCTNoRationaleLabel.Top is greater than the maximum
for an integer. The report is printing all of the controls fine, but I am
unable to get at the actual value of Me.PCTNoRationaleLabel.Top to create the
box as it is only given to me as an integer. What can I do?


Something else is wrong. A report section's Height can be a
maximum of 32767 twips. so it is impossible for a control to
have it's Top off the end of its section.
 
P

Paul Luxton

I have created a test DB (Access 2003 SP3 on Windows XP SP3). A table with
two memo fields. A report showing both these memo fields. The text controls
are placed in the design of the report in such a way that there is plenty of
room left before the end of the detail section. At run time the data is such
that the bottom (Top + Height) of the (can grow) text control containing
field 1 has a value of 32760. The line box draws OK, and the second (can
grow) text control holding field 2 draws fine, even though the Top of the
second text control has a value of 32767. When I add more data in to field 1
so that at run time the value of Top + Height is now greater than 32767, the
text control draws fine, the following text control draws fine, but the line
box looks like it tries to draw backwards to the top of the detail section. I
can e-mail the mdb if that helps.
 
M

Marshall Barton

Paul said:
I have created a test DB (Access 2003 SP3 on Windows XP SP3). A table with
two memo fields. A report showing both these memo fields. The text controls
are placed in the design of the report in such a way that there is plenty of
room left before the end of the detail section. At run time the data is such
that the bottom (Top + Height) of the (can grow) text control containing
field 1 has a value of 32760. The line box draws OK, and the second (can
grow) text control holding field 2 draws fine, even though the Top of the
second text control has a value of 32767. When I add more data in to field 1
so that at run time the value of Top + Height is now greater than 32767, the
text control draws fine, the following text control draws fine, but the line
box looks like it tries to draw backwards to the top of the detail section. I
can e-mail the mdb if that helps.

Ahhh, I see now. Sounds like a big problem because Help
says the Top property is an Integer. An Integer value
greater than 32767 has it's high bit set would normally
cause an overflow error, but I guess the conversion is done
somewhere behind the scenes either dropping the 16th bit or
leaving ot in as the sign bit (i.e. negative).

The only thought that comes to mind is to put each of those
text boxes in a different section. This can be done by
adding a group header and/or footer section to the detail
sorting level in Sorting and Grouping, Then you can spread
the controls you currently have in the detail section across
three sections.
 
P

Paul Luxton

I had looked at that idea as a possible way round the problem. Thanks for
your help. I will get on to it.
 

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