473,692 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report Text Box Height - Always the same height as the detail section

44 New Member
Hi,

I'd like to produce a report that basically looks like an excel printout.

Description:
Profile Print Report
Detail Section with 3 bordered text boxes
all text boxes are 'abutted' against each other (where one ends, the next begins)
all text boxes have the 'can grow' property set to yes.
Detail Section with 'can grown' = yes

Desire:
allow that all 3 cells grow equally.

However, I would like the bordered cells to always be of the same height.

Basically, if one text box is taller than the other 2, the other two have adequate whitespace inside the textbox to cause all 3 to be of equal height.

What event of the detail section can I use so that either all 3 text boxes end up as tall as the detail section or each text box height = the height of the tallest text box after it has 'grown'?

Thanks!
Sep 20 '07 #1
7 13386
Jim Doherty
897 Recognized Expert Contributor
Hi,

I'd like to produce a report that basically looks like an excel printout.

Description:
Profile Print Report
Detail Section with 3 bordered text boxes
all text boxes are 'abutted' against each other (where one ends, the next begins)
all text boxes have the 'can grow' property set to yes.
Detail Section with 'can grown' = yes

Desire:
allow that all 3 cells grow equally.

However, I would like the bordered cells to always be of the same height.

Basically, if one text box is taller than the other 2, the other two have adequate whitespace inside the textbox to cause all 3 to be of equal height.

What event of the detail section can I use so that either all 3 text boxes end up as tall as the detail section or each text box height = the height of the tallest text box after it has 'grown'?

Thanks!
Have look at the LINE method in an Access Report to draw a rectangle around each of the text boxes. (examine the arguments that constitute that method, particularly the last argument if you wish to fill the rectangle with a specific colouring)

By looping through the controls you intend to work with ie: referenced in an zero based array you could thus draw a rectangle around each one commensurate with the height of the 'tallest' textbox control referenced.

This would then give the 'appearance' of each textbox having the same height with borders in effect 'drawn' at runtime. (you could set the actual border color property of each control itself to the same as the detail section)

If as you say the textboxes are butted up to each other arranged left to right in the detail section of the report with the controls set to grow, then try the following in the ON PRINT property of the detail section. (I,ll leave you to deal with your own error handling)

Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next 
  2. Dim lngCounter As Long, dblMaxHeight As Double 
  3. dblMaxHeight = 0 
  4. ReDim strcontrol(3) 
  5. strcontrol(0) = "TheNameOfYourTextBoxOne
  6. strcontrol(1) = "TheNameOfYourTextBoxTwo
  7. strcontrol(2) = "TheNameOfYourTextBoxThree
  8. For lngCounter = 0 To UBound(strcontrol) 
  9. If Me(strcontrol(lngCounter)).Height > dblMaxHeight Then dblMaxHeight = Me(strcontrol(lngCounter)).Height 
  10. Next 
  11. For lngCounter = 0 To UBound(strcontrol) 
  12. If lngCounter = 0 Then 
  13. Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B 
  14. Else 
  15. Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B 
  16. End If 
  17. Next
  18.  
Hope this helps you

Regards

Jim
Sep 21 '07 #2
NJonge01
44 New Member
Jim,

Sorry for the late reply! I have introduced your code and it is near perfect on the first effort! I think I have something in my on print event or the properties of the text boxes that are causing some issues. I will address those and I believe this approach can give me exactly what I need.

Thank you so much and again my apologizes for the late response... I've been away from this project for some weeks.
Oct 6 '07 #3
Jim Doherty
897 Recognized Expert Contributor
Jim,

Sorry for the late reply! I have introduced your code and it is near perfect on the first effort! I think I have something in my on print event or the properties of the text boxes that are causing some issues. I will address those and I believe this approach can give me exactly what I need.

Thank you so much and again my apologizes for the late response... I've been away from this project for some weeks.
Glad it helps you. The line method is an appropriate use in reports in your case as a workaround because Access will throw an error if you try to resize a textbox 'in itself' once printing commences using the on format or on print events.

Regards

Jim
Oct 7 '07 #4
doulostheou
2 New Member
This code should do exactly what I am needing for a report I am working on as well. However, I am running into an odd problem. It is acting like the code is grabbing the control height before the can grow property runs. All of the lines are being drawn, but they are drawn to the size of the original text boxes (in the design view), not to the size of the text boxes after the can grow property. Any thoughts?
Jan 20 '08 #5
Jim Doherty
897 Recognized Expert Contributor
This code should do exactly what I am needing for a report I am working on as well. However, I am running into an odd problem. It is acting like the code is grabbing the control height before the can grow property runs. All of the lines are being drawn, but they are drawn to the size of the original text boxes (in the design view), not to the size of the text boxes after the can grow property. Any thoughts?
I've never had that issue myself, make sure you have no overlapping controls and that they sit horizontally side by side and that you are using this is the on print property. The 'growing' should be taking place before the on print with the lines drawn to the 'tallest' textbox one in any group

Jim :)
Jan 21 '08 #6
ramies
2 New Member
i never expect that it would be so difficult to draw lines on the report. tremendous to understand. unusual programmer . what i had in mind to do is to make spaces on every record. make a new table and fill them all with same amount of data for every record line.
Feb 22 '08 #7
ramies
2 New Member
i need to study the code that you presented. anyway thank you
Feb 22 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
15041
by: dixie | last post by:
I know I've asked this question in the last week, but no matter how hard I look, I can't find it. So I'll type it again. Is it possible to set the height of the detail section of a report using vba? I want to be able to set the height in a table and have the detail section adjust to that height, no matter what it is really set to. Is that feasible, or is it no. If so, what is the syntax for setting the height of the detail section of...
1
5761
by: Tom | last post by:
In the Developers Handbook, Getz provides a way to create a survey report that displays either a line, Yes/No or multiple choice for each question. It's done by placing three controls (one for each type of answer) in the report's detail section and then making the control appropriate for each question visible in the Format event of the detail section. Can this be simulated in a form? There's no Detail Format event for a form but can it be...
4
1602
by: Lyle Fairfield | last post by:
I had a Sproc which returned a field called Details. I had the Form Wizard create a continuous form with the Sproc as the RecordSource (as a shell for me to modify). I renamed the Details textbox to txtDetails. Except I didn't. I grabbed DETAIL from the pulldown and renamed it to TxtDetail.
4
3155
by: Mal Reeve | last post by:
Hello, I have a report that has only 2 levels of grouping. The detail section is simply 1 large block for a memo field. I am finding that on some occasions the report errors and generates hundreds (perhaps even an infinite loop...I have to break the system to stop the report generating) of pages. While I'm not 100% I think this may have something to do with the detail
0
1614
by: Tim Marshall | last post by:
Access 2003. A report of mine was hanging on print preview. It turned out the issue was a bound text box where the data was too big to fit all on one page. When I changed the "keep together" property for the detail section to NO, the report previewed and performed as expected. However, I'm now faced with a minor irritant I'd like to be able to deal with. Some other records with far less content in the text box at issue end up getting...
4
4448
by: Karl | last post by:
How do you set the width of a control in the detail section of a report using the On Format event for the detail section?
10
11754
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines. It seems the simplest thing is to run the code (see below) once with the detail section showing, and a second time hiding the detail section. I can't figure out the code to do that and don't see it posted.
1
2812
by: peterkennett | last post by:
OK, I’m new to all this, so forgive me if I missed some easy answer to this problem! I have a report, which is actually going to be a letter. I had no problem adding my return address, salutation and top two paragraphs in the HEADER section. I also have no problem with the DETAIL section printing out the few records I need to show. But now I want to add a closing paragraph immediately after the DETAIL section. I tried to add it in the FOOTER...
2
4441
by: emckesso | last post by:
Hello, I need to create conditional formatting of a text box in the detail section of a report. The formatting is based on multiple parameters that are stored in a query. For example, pretend that = 50%, = 80%, and = 90%. I will check in the report against (from the query, but currently stored in a text box on the report via a Dlookup - textbox name is still ). If is less than then I want to compare the value of (another report...
0
8600
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9079
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8954
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8794
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5817
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4322
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4555
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1955
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.