Resize one control to match the height of another Version: 2003(11.0)

K

keaven

I have a report where there are two CanGrow controls, ProbTitle and
Staff_Comments. I also have three boxes (Vote_A, _B, and _C) which need
to grow to match the height of the longer of the two CanGrow controls.

Here is my (non-working) code that I put in the Detail's OnFormat event:

Code:

' Makes boxes fill entire height of row... or not.
If Me![ProbTitle].Height < Me![Staff_Comments].Height Then
Me![Vote_A].Height = Me![Staff_Comments].Height
Me![Vote_B].Height = Me![Staff_Comments].Height
Me![Vote_C].Height = Me![Staff_Comments].Height
Else
Me![Vote_A].Height = Me![ProbTitle].Height
Me![Vote_B].Height = Me![ProbTitle].Height
Me![Vote_C].Height = Me![ProbTitle].Height
End If


The problem is that Access doesn't know the height of the controls until
the OnPrint event, but you can't set the height of a control in the
OnPrint event.

I remember reading something about processing a report twice in order
for calculated sizes to be known, but i have no idea how to implement
something like that, if its even do-able. Is there any other way for me
to handle this?

-keaven



--
-----------------------------------------------------------------------
Keaven Freeman "There's no place like 127.0.0.1"
usenet[@]keaven[.]com ICQ: 35133457
http://www.keaven.com IM: KeavenMJ
"The box said 'Requires Windows 95 or better' ... so I installed Linux"
-----------------------------------------------------------------------
 
S

Stephen Lebans

You've asked this same question several times now. If you are unable to
find the replies to your original posts then use GoogleGroups:
http://www.google.ca/groups?num=100&hl=en&lr=&scoring=d&q=keaven+group%3
A*access*

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


keaven said:
I have a report where there are two CanGrow controls, ProbTitle and
Staff_Comments. I also have three boxes (Vote_A, _B, and _C) which need
to grow to match the height of the longer of the two CanGrow controls.

Here is my (non-working) code that I put in the Detail's OnFormat event:

Code:

' Makes boxes fill entire height of row... or not.
If Me![ProbTitle].Height < Me![Staff_Comments].Height Then
Me![Vote_A].Height = Me![Staff_Comments].Height
Me![Vote_B].Height = Me![Staff_Comments].Height
Me![Vote_C].Height = Me![Staff_Comments].Height
Else
Me![Vote_A].Height = Me![ProbTitle].Height
Me![Vote_B].Height = Me![ProbTitle].Height
Me![Vote_C].Height = Me![ProbTitle].Height
End If


The problem is that Access doesn't know the height of the controls until
the OnPrint event, but you can't set the height of a control in the
OnPrint event.

I remember reading something about processing a report twice in order
for calculated sizes to be known, but i have no idea how to implement
something like that, if its even do-able. Is there any other way for me
to handle this?

-keaven



--
---------------------------------------------------------------------- -
Keaven Freeman "There's no place like 127.0.0.1"
usenet[@]keaven[.]com ICQ: 35133457
http://www.keaven.com IM: KeavenMJ
"The box said 'Requires Windows 95 or better' ... so I installed Linux"
----------------------------------------------------------------------
-
 
K

keaven

There must be something wrong with my client then. I tried to post this
on the 15th, but i never saw it come through. I saw other posts come
through on the 15th, but not mine. I thought the problem was with my
server, that's why i posted it again. I didn't intend to flood. My
apologies.

-keaven


Stephen said:
You've asked this same question several times now. If you are unable to
find the replies to your original posts then use GoogleGroups:
http://www.google.ca/groups?num=100&hl=en&lr=&scoring=d&q=keaven+group%3
A*access*

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


I have a report where there are two CanGrow controls, ProbTitle and
Staff_Comments. I also have three boxes (Vote_A, _B, and _C) which
need

to grow to match the height of the longer of the two CanGrow controls.

Here is my (non-working) code that I put in the Detail's OnFormat
event:

Code:

' Makes boxes fill entire height of row... or not.
If Me![ProbTitle].Height < Me![Staff_Comments].Height Then
Me![Vote_A].Height = Me![Staff_Comments].Height
Me![Vote_B].Height = Me![Staff_Comments].Height
Me![Vote_C].Height = Me![Staff_Comments].Height
Else
Me![Vote_A].Height = Me![ProbTitle].Height
Me![Vote_B].Height = Me![ProbTitle].Height
Me![Vote_C].Height = Me![ProbTitle].Height
End If


The problem is that Access doesn't know the height of the controls
until

the OnPrint event, but you can't set the height of a control in the
OnPrint event.

I remember reading something about processing a report twice in order
for calculated sizes to be known, but i have no idea how to implement
something like that, if its even do-able. Is there any other way for
me

to handle this?

-keaven

--
-----------------------------------------------------------------------
Keaven Freeman "There's no place like 127.0.0.1"
usenet[@]keaven[.]com ICQ: 35133457
http://www.keaven.com IM: KeavenMJ
"The box said 'Requires Windows 95 or better' ... so I installed Linux"
-----------------------------------------------------------------------
 

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