473,832 Members | 2,301 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Increase line length if a field on a report grows

74 New Member
I have created a report that looks like a spreadsheet. The only problem is that when one of the cell grows (cangrow property is yes) then the lines beside them are not long enough. I tried this code in the on format event of the form detail section

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3. Me.Line96.Height = Me.description.Height
  4. Me.Line95.Height = Me.description.Height
  5. Me.Line94.Height = Me.description.Height
  6. Me.Line93.Height = Me.description.Height
  7. Me.Line92.Height = Me.description.Height
  8. Me.Line91.Height = Me.description.Height
  9. Me.Line90.Height = Me.description.Height
  10. Me.Line109.Height = Me.description.Height
  11.  
  12. End Sub
  13.  
But nothing changed. There will be multiple rows printing out on this report. Is there anyway to see how much the cell grows, or (through code) if the cell is going to grow, and if yes by how much. Then I could just set the height of the lines first.....maybe .

I have only made the one field (description) able to grow, and the field walls are transparent so that the height will only be decided by the sigle field.

Any help will be greatly appreciated.
Mar 3 '09 #1
3 4630
ADezii
8,834 Recognized Expert Expert
@kstevens
The following code will dynamically create a Vertical Line of any Width you so desire, which will be of the same Height of a Control on a Report whose CanGrow and CanShrink Properties are set to Yes. The code must reside in the Print Event of either the Detail Section or a Footer Section. In this demo, I generated a Vertical Line directly to the Left of a Description Control within a Report's Detail Section. The Line will dynamically grow to accommodate varying Heights of the Description Control. In this case, a Picture is worth 1,000 words, so download the Attachment and see what is going on. If you have any questions, please feel free to ask.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
  2. Dim sngLineTop As Single
  3. Dim sngLineLeft As Single
  4. Dim sngLineWidth As Single
  5. Dim sngLineHeight As Single
  6.  
  7. Const conTWIPS = 1
  8. Const conSOLID = 0
  9.  
  10. Me.ScaleMode = conTWIPS
  11. Me.DrawStyle = conSOLID
  12.  
  13. 'Set the Line coordinates
  14. sngLineTop = Me![Description].Top
  15. sngLineLeft = (Me![Description].Left - 50)
  16. sngLineWidth = 25   'Width of Line
  17.  
  18. With Me![Description]
  19.   sngLineHeight = .Height
  20. End With
  21.  
  22. 'Now, draw the Line with the Box Fill Option
  23. Me.Line (sngLineLeft, sngLineTop)-Step(sngLineWidth, sngLineHeight), , BF
  24. End Sub
Mar 4 '09 #2
kstevens
74 New Member
Thanks ADezzi,

I modified the code like this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
  2.  
  3. Const conTWIPS = 1
  4. Const conSOLID = 0
  5.  
  6. Me.ScaleMode = conTWIPS
  7. Me.DrawStyle = conSOLID
  8.  
  9. Me.Line ((Me![LineItem].Left - 10), Me![LineItem].Top)-Step(3, Me![description].Height), , BF
  10. Me.Line ((Me![LineQty].Left - 10), Me![LineQty].Top)-Step(3, Me![description].Height), , BF
  11. Me.Line ((Me![Text111].Left - 10), Me![Text111].Top)-Step(3, Me![description].Height), , BF
  12. Me.Line ((Me![description].Left - 10), Me![description].Top)-Step(3, Me![description].Height), , BF
  13. Me.Line ((Me![SerialNum].Left - 10), Me![SerialNum].Top)-Step(3, Me![description].Height), , BF
  14. Me.Line ((Me![WorkOrderNumber].Left - 10), Me![WorkOrderNumber].Top)-Step(3, Me![description].Height), , BF
  15. Me.Line ((Me![InvoiceNo].Left - 10), Me![InvoiceNo].Top)-Step(3, Me![description].Height), , BF
  16. Me.Line ((Me![temp].Left - 10), Me![temp].Top)-Step(3, Me![description].Height), , BF
  17. End Sub
  18.  
And it worked great. Thanks for the reply...... Do you really just sit around and wirte experimental databases just to upload...., crazy if you do, but it is very much appreciated.
Mar 4 '09 #3
ADezii
8,834 Recognized Expert Expert
@kstevens
Glad it worked out for you.
Mar 5 '09 #4

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

Similar topics

5
2479
by: Tony Clarke | last post by:
Hi, Background: I have written a Call Logging and Reporting System using PHP that integrates with an existing MS Access Database. The information in the database is all held in flat tables with no relationships (I don't know why they did this) and the users are currently using VBA forms to enter info into the database, this meant that each time someone wanted to do a report of the call's recorded over the last week that they would...
7
2818
by: jamait | last post by:
Hi all, I m trying to read in a text file into a datatable... Not sure on how to split up the information though, regex or substrings...? sample: Col1 Col2 Col3 Col4 A0012430 REKAL TVÄTTMEDEL EKOMAX 0,5L ST 75.9000
6
1404
by: Darren Dale | last post by:
Is there a module somewhere that intelligently deals with reports to the command line? I would like to report the progress of some pretty lengthy simulations, and currently I have the new reports written on a new line rather rather than overwriting the previous report. Thanks, Darren
3
5195
by: gary | last post by:
Hi, 1. About all C/C++ compilers, Does stack increase from high address to low address and heap grow increase from low to high? What on earth decides their increase direction, CPU architecture, OS or compiler? 2. In GNU gcc, { int a = {0, 1, 2, 3, 4}; bool b; float c; for (int i = 0; i < 5; i++) {
4
22780
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary to export the report? I tried exporting a report by using the .rtf rich-text format (the plain-text format was the only other word-processing option listed when exporting). I then opened the .rtf file in Word. However, it looks like some...
5
2455
by: ChadDiesel | last post by:
My basic question is why does my print report button on my subform print a blank report when my cursor is on a blank entry line? Here is a more detailed explanation of my problem. I have a form that contains shipment destination information and a subform that contains boxes for that shipment. The main form is a table called Ship_Info, and the subform is a table called Label_Info. They both contain and are linked by a field called...
5
2786
by: RThaden | last post by:
Hi all, I have a text file with a list of MAC addresses. Each time, my program is called it reads the last MAC address entry from the file, increases it by one, writes this new address into a 6 byte binary file and stores the new address in text representation in the text file. Looks like this 00-0C-F1-B9-A1-11 00-0C-F1-B9-A1-12
5
4060
by: John | last post by:
Hi I have a typical front end/back end access app. Additionally a vb.net app accesses the backend mdb file every few minutes and runs insert and update queries on some table. The data to be inserted and updated is coming from a remote db. The mdb file size is normally around 80MB but since running the vb.net app the mdb file size grows to 1GB or so every few days. After compact and repair the size does get back to 80MB but it is still a...
10
1734
by: uche | last post by:
Hello all! I have thought about this question for a long time and I would like to know your opinion about it: In C, a variable-length string can be carried in RAM as a sequence of ASCII characters followed by a NULL character. Would this work in a disk field? What are some considerations to be aware of?
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
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
10497
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
10539
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
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
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
6951
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
5623
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
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.