473,471 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

setting control heights in a report

I've got a report with memo fields set to "CanGrow". Next to this text
box is a combo box. I want the combo box to be as tall as the text box
after it grows. I've tried the following in my code:

ComboBox.Height = TextBox.Height

.... but it's still giving me the height of the text box prior to
growth. Anybody have any solutions?
Sep 5 '08 #1
6 4382
On Fri, 5 Sep 2008 13:27:35 -0700 (PDT), evenlater wrote:
I've got a report with memo fields set to "CanGrow". Next to this text
box is a combo box. I want the combo box to be as tall as the text box
after it grows. I've tried the following in my code:

ComboBox.Height = TextBox.Height

... but it's still giving me the height of the text box prior to
growth. Anybody have any solutions?
You can use the Line method to draw a box around the control.

1) Better to use a Text control in the report, not a combo box.
You can't use the drop-down in the report anyway, and the box will not
fill in properly using a Combo box.

2) Set the Text (or if you insist, the Combo) control's Border Style
to Transparent.

3) Set the Memo control's Border Style to Solid.

4) Code the Detail Print event:

Dim lngHeight As Long
Dim X1 As Single
Dim Y1 As Single
Dim Y2 As Single
Dim X2 As Single
Me.DrawStyle = 0

lngHeight = Me.Memo.Height
X1 = [TextControl].Left
X2 = [TextControl].Left + [TextControl].Width
Y1 = [TextControl].Top
Y2 = [TextControl] + lngHeight

Me.Line (X1, Y1)-(X2, Y2), 0, B

Change [TextControl] to the actual name of your Text or Combo Box
Control's name.
Change Memo to the actual name of your memo control.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 5 '08 #2
Terrific, that's what I'm looking for... EXCEPT: I've actually got one
text box and one combo box (which I've now changed to a text box at
your suggestion) to the left of the memo field that "CanGrow." The
(ex-) combo box has its back color determined at run-time depending on
the value. So now the question is: how can I have the back color of
this middle field extend from the top of the row to the bottom of the
memo field? I can't change the back color of the detail section
because the field on the left needs to be white.

You have an answer for that one too?
Sep 6 '08 #3
On Sat, 6 Sep 2008 13:52:44 -0700 (PDT), evenlater wrote:
Terrific, that's what I'm looking for... EXCEPT: I've actually got one
text box and one combo box (which I've now changed to a text box at
your suggestion) to the left of the memo field that "CanGrow." The
(ex-) combo box has its back color determined at run-time depending on
the value. So now the question is: how can I have the back color of
this middle field extend from the top of the row to the bottom of the
memo field? I can't change the back color of the detail section
because the field on the left needs to be white.

You have an answer for that one too?
What criteria determines the color that you wish to fill in?
What is the color?

Dim lngHeight As Long
Dim X1 As Single
Dim Y1 As Single
Dim Y2 As Single
Dim X2 As Single
Me.DrawStyle = 0

Dim lngX As Long
If [LastName] = "Jones" Then
lngX = vbYellow
Else
lngX = 16777215
End If

lngHeight = Me.Paragraph.Height
X1 = Label1.Left
X2 = Label1.Left + Label1.Width
Y1 = Label1.Top
Y2 = Label1.Top + lngHeight

Me.Line (X1, Y1)-(X2, Y2), lngX, BF

' If you ALSO wish to have a black border around the above colored box
add
Me.Line (X1, Y1)-(X2, Y2), vbBlack, B

End Sub

Change the criteria and the colors as needed.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 6 '08 #4
Great, you're making me a very happy programmer. But for some reason
it doesn't seem to be consistently drawing the borders around the
colored boxes even though I do have the two lines:

r.Line (X1, Y1)-(X2, Y2), lngColor, BF
r.Line (X1, Y1)-(X2, Y2), 0, B

Sometimes it has a faint border and sometimes it doesn't... ?
Sep 6 '08 #5
On Sat, 6 Sep 2008 15:38:39 -0700 (PDT), evenlater wrote:
Great, you're making me a very happy programmer. But for some reason
it doesn't seem to be consistently drawing the borders around the
colored boxes even though I do have the two lines:

r.Line (X1, Y1)-(X2, Y2), lngColor, BF
r.Line (X1, Y1)-(X2, Y2), 0, B

Sometimes it has a faint border and sometimes it doesn't... ?
You really should include the relevant portion of the message you are
replying to. Without it, I have to search out the previous message to
see what it is you are talking about.

Is it consistent if you set the DrawWidth property to 5 (or higher)?
Try different values.
Dim ...etc....
Me.DrawStyle = 0
Me.DrawWidth = 5
If [LastName] = "Contessa" Then
......etc....

Other than this I have no idea.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 7 '08 #6
Yeah, I did try increasing the DrawWidth and it's still inconsistent.
Thanks for your help.

On Sep 6, 7:57*pm, fredg <fgutk...@example.invalidwrote:
On Sat, 6 Sep 2008 15:38:39 -0700 (PDT), evenlater wrote:
Great, you're making me a very happy programmer. But for some reason
it doesn't seem to be consistently drawing the borders around the
colored boxes even though I do have the two lines:
r.Line (X1, Y1)-(X2, Y2), lngColor, BF
r.Line (X1, Y1)-(X2, Y2), 0, B
Sometimes it has a faint border and sometimes it doesn't... ?

You really should include the relevant portion of the message you are
replying to. Without it, I have to search out the previous message to
see what it is you are talking about.

Is it consistent if you set the DrawWidth property to 5 (or higher)?
Try different values.
Dim ...etc....
Me.DrawStyle = 0
Me.DrawWidth = 5
If [LastName] = "Contessa" Then
.....etc....

Other than this I have no idea.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 7 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: netclectic | last post by:
I'm dynamically adding options to a select list in javascript and i need to be able to set the height of the option, but setting style.height has not effect, I also tried style.pixelHeight but no...
3
by: cpt | last post by:
I read that if one uses "table-layout:fixed" then table rendering is speeded by setting row height. All my rows are 285 px high. 1) Is this true? 2) If true, how does one set row-height for the...
12
by: Andy Jeffries | last post by:
Hi all, I want to write a function that given two elements will make their heights equal to the larger element. I've had a go at it and it works, but it makes both their heights larger than...
6
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get...
5
by: dixie | last post by:
I want to be able to set the font size and font type for text in a text box on a report using VBA. I wan't to be able to control it from a setting in a table. The problem is that I don't know the...
2
by: Mikkel Faarup | last post by:
Hi All I am are experiencing difficulties setting Windows.Form heights above around 1000px on screens with the resolution set to 1024x768. The form is simply cut off and a scrollbar is set. The...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
1
by: simon | last post by:
I have an unbound RTF2 control in an Access 2003 form which I set to show either unformatted text or else text with words and sentences highlighted. I do this by setting the PlainText property,...
4
by: Bill | last post by:
I have a command button that opens the a report. On the report the bulk of the information is in the sub report. I have a check box on the form that if isn't check will cause a field to be...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.