line spacing of memo field

M

Michael Lei

Hi All,
I am using the VBA command "print" to print memo field in a report.
How can I program the line spacing when I use the mentioned command.

Thanks a lot!

Michael
 
J

John Spencer

A text control in Access 2002 (and perhaps earlier) has a line spacing
property that can be set to control the spacing between lines.

The VBA print command prints to the immediate window (as in Debug.Print
The VBA Print # statement writes information to a file.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
M

Michael Lei

Dear John,
Thanks to your reply!
I still don't know how to set, soryy!
Could you tell me what command I can use to set the line spacing.
And I know how to set the font name and font size by using the following
command,

with rpt
..fontname="Arial"
..fontsize=10
end with
rpt.print

Thanks!

Michael
 
S

Stephen Lebans

The report object Print method does not expose a line spacing property. You
need to ouput each line individually setting CurrentY to achieve the desired
line spacing value.

--

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

Michael Lei

thank you Stephen!

What I want is to print a memo field. How can I get one line from a memo
field? Thanks!
 
S

Stephen Lebans

There is no simple solution.
It's relatively straightforward if you are using a fixed width font such as
Courier as then you can simply output a fixed number of characters per line,
but you still have to deal with word breaks.
With a variable width font, in addition to calculating word breaks you also
have to determine character widths individually.

I really would suggest you forget about trying to output the text yourself
via the report object's Print method and simply use the standard TextBox
control. If for some reason you cannot take this advice then look at the
JustiDirect solution on my site. It is the worse spaghetti code I have ever
produced but it does work.


--

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

Chuck

thank you Stephen!

What I want is to print a memo field. How can I get one line from a memo
field? Thanks!
Are you trying to print:
All the lines of a memo field that has several lines?
One line from a memo field that has several lines?
A memo fielf that always has only one line?

Chuck
 

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