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 -
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
-
-
Me.Line96.Height = Me.description.Height
-
Me.Line95.Height = Me.description.Height
-
Me.Line94.Height = Me.description.Height
-
Me.Line93.Height = Me.description.Height
-
Me.Line92.Height = Me.description.Height
-
Me.Line91.Height = Me.description.Height
-
Me.Line90.Height = Me.description.Height
-
Me.Line109.Height = Me.description.Height
-
-
End Sub
-
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.
3 4565 @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. - Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
-
Dim sngLineTop As Single
-
Dim sngLineLeft As Single
-
Dim sngLineWidth As Single
-
Dim sngLineHeight As Single
-
-
Const conTWIPS = 1
-
Const conSOLID = 0
-
-
Me.ScaleMode = conTWIPS
-
Me.DrawStyle = conSOLID
-
-
'Set the Line coordinates
-
sngLineTop = Me![Description].Top
-
sngLineLeft = (Me![Description].Left - 50)
-
sngLineWidth = 25 'Width of Line
-
-
With Me![Description]
-
sngLineHeight = .Height
-
End With
-
-
'Now, draw the Line with the Box Fill Option
-
Me.Line (sngLineLeft, sngLineTop)-Step(sngLineWidth, sngLineHeight), , BF
-
End Sub
Thanks ADezzi,
I modified the code like this -
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
-
-
Const conTWIPS = 1
-
Const conSOLID = 0
-
-
Me.ScaleMode = conTWIPS
-
Me.DrawStyle = conSOLID
-
-
Me.Line ((Me![LineItem].Left - 10), Me![LineItem].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![LineQty].Left - 10), Me![LineQty].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![Text111].Left - 10), Me![Text111].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![description].Left - 10), Me![description].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![SerialNum].Left - 10), Me![SerialNum].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![WorkOrderNumber].Left - 10), Me![WorkOrderNumber].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![InvoiceNo].Left - 10), Me![InvoiceNo].Top)-Step(3, Me![description].Height), , BF
-
Me.Line ((Me![temp].Left - 10), Me![temp].Top)-Step(3, Me![description].Height), , BF
-
End Sub
-
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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 ...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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,...
|
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...
| |