Three Report Questions

P

Paul Martin

I ma trying to replicate from an earlier database the ability to print
individual records to my Dymo label printer and, at the same time, introduce
some improvements. So far this has prompted three questions i would be
grateful for some help with.

SINGLE LABEL
Despite copying most of the report from an earlier database I can't see what
property it is that makes it just print the current label.

In normal operation the report it called from a button placed on the form
and I only want it to printed fields from that current record.

What am I missing?

FORMATTING IN AN EXPRESSION

The name fields are group in a single text box with this expression
=([ContactTitle]+" ") & [ContactFirstName] & " " & [ContactLastName]

If I wanted to expand that expression so that all the fields for the report
were in a single text box, as has been suggested to me as a way of
suppressing empty fields, what character forces a line break?

VIEW
This is purely a cosmetic thing whilst trying to format my label but is
their a way to zoom in the view in design view? I am finding it difficult to
get all the text boxes lined up with its normal view.


Thanks in anticipation of help

Paul Martin
 
B

Baz

SINGLE LABEL: Use the WhereCondition argument of the DoCmd.OpenReport
statement

FORMATTING IN AN EXPRESSION: vbCrLf forces a line break. Better is to use
separate text boxes for each line and set their "Can Shrink" property to
True. Make sure the text boxes don't overlap otherwise they will not
shrink.

VIEW: change your screen resolution. Or, select all the text boxes and use
the "Align Left" option on the short cut (right click) menu.
 
P

Paul Martin

SINGLE LABEL
Sorry you've lost me there. What you have written is double dutch to me
Where do i look for this and what does it mean

FORMATTING EXPRESSION
I was looking at the single text box option following previous advice from
this group which said the single record was better than individual boxes and
that if i kept individual boxes they should touch.

Sorry, but i am not a techy I am just trying to use the software

Paul

Baz said:
SINGLE LABEL: Use the WhereCondition argument of the DoCmd.OpenReport
statement

FORMATTING IN AN EXPRESSION: vbCrLf forces a line break. Better is to use
separate text boxes for each line and set their "Can Shrink" property to
True. Make sure the text boxes don't overlap otherwise they will not
shrink.

VIEW: change your screen resolution. Or, select all the text boxes and
use
the "Align Left" option on the short cut (right click) menu.

Paul Martin said:
I ma trying to replicate from an earlier database the ability to print
individual records to my Dymo label printer and, at the same time, introduce
some improvements. So far this has prompted three questions i would be
grateful for some help with.

SINGLE LABEL
Despite copying most of the report from an earlier database I can't see what
property it is that makes it just print the current label.

In normal operation the report it called from a button placed on the form
and I only want it to printed fields from that current record.

What am I missing?

FORMATTING IN AN EXPRESSION

The name fields are group in a single text box with this expression
=([ContactTitle]+" ") & [ContactFirstName] & " " & [ContactLastName]

If I wanted to expand that expression so that all the fields for the report
were in a single text box, as has been suggested to me as a way of
suppressing empty fields, what character forces a line break?

VIEW
This is purely a cosmetic thing whilst trying to format my label but is
their a way to zoom in the view in design view? I am finding it difficult to
get all the text boxes lined up with its normal view.


Thanks in anticipation of help

Paul Martin
 
D

Douglas J. Steele

Paul Martin said:
SINGLE LABEL
Despite copying most of the report from an earlier database I can't see
what property it is that makes it just print the current label.

In normal operation the report it called from a button placed on the form
and I only want it to printed fields from that current record.

What am I missing?

To limit what's being printed in a report, you need to change the
RecordSource of the report so that it only returns the row(s) of interest.
You can do this by changing the query that constitutes the RecordSource, or
you can set a filter or pass a Where statement when you open the report.

The OpenReport method has the following syntax:

DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

where filtername is a string expression that's the valid name of a query in
the current database. and wherecondition is a string expression that's a
valid SQL WHERE clause without the word WHERE.

For example, if you know the ID of the single record you want printed, you'd
do something like:

DoCmd.OpenReport "MyGreatReport", wherecondition:="ID = 5"

Since it's doubtful you want to hardcode an ID number, you can refer to a
variable that contains the value:

DoCmd.OpenReport "MyGreatReport", wherecondition:="ID = " & lngCurrentID

or you can refer to a control on the form:

DoCmd.OpenReport "MyGreatReport", wherecondition:="ID = " & Me!CustomerId
FORMATTING IN AN EXPRESSION

The name fields are group in a single text box with this expression
=([ContactTitle]+" ") & [ContactFirstName] & " " & [ContactLastName]

If I wanted to expand that expression so that all the fields for the
report were in a single text box, as has been suggested to me as a way of
suppressing empty fields, what character forces a line break?

Use Chr(13) & Chr(10) in that order. (that's Carriage Return and Line Feed
respectively). Within VBA, you can use the intrinsic constant vbCrLf
instead.

=([ContactTitle]+" ") & [ContactFirstName] & " " & [ContactLastName] &
Chr(13) & Chr(10) & [Address] & Chr(13) & Chr(10) & [City]
VIEW
This is purely a cosmetic thing whilst trying to format my label but is
their a way to zoom in the view in design view? I am finding it difficult
to get all the text boxes lined up with its normal view.

There are a number of ways to line up controls. You can select all of the
controls you want lined up the same way (either by "lassoing" them, or by
holding down the shift key while you click each control) and then look under
the Format menu for the Align options. You also have the option of having
controls "snap to the grid" (the dots that appear on the report in Design
mode). If you want a different granularity for the grid, you can change the
GridX and GridY values for the report. You also have the option of
explicitly setting the Left, Top, Width and Height properties for each
control so that you get the same.
 
B

Baz

Well excuuuuse me, but since you already have a working report launched from
a command button I think it was a reasonable assumption on my part that you
knew how to open a report from a command button.

You will need to open the form in design view, open the properties window
for the command button in question, click on the "Events" tab, click on the
"On Click" property, and then click the button which appears on the right
(the one with the three dots). This will open the code window where you
will see the OpenReport statement. Then see Doug Steele's post about the
syntax of OpenReport (or challenge yourself and look it up in the help
system).

Regarding the formatting of an address, I've given you my advice, if you
prefer someone else's advice then I can't help you any further. This
newsgroup is populated by diverse individuals, there are no right or wrong
answers, only opinions. It's up to you to decide whose advice, if any, you
wish to follow. I will say, however, that given your lack of understanding
of Access I think you will find the "single text box" approach somewhat
challenging. The method described by Doug Steele will not suppress blank
lines. There are ways of achieving this in a single text box, but I've
already given you a simpler alternative. The borders of the individual text
boxes can "touch", but they must not overlap otherwise they will not shrink
and you will still get blank lines.

Paul Martin said:
SINGLE LABEL
Sorry you've lost me there. What you have written is double dutch to me
Where do i look for this and what does it mean

FORMATTING EXPRESSION
I was looking at the single text box option following previous advice from
this group which said the single record was better than individual boxes and
that if i kept individual boxes they should touch.

Sorry, but i am not a techy I am just trying to use the software

Paul

Baz said:
SINGLE LABEL: Use the WhereCondition argument of the DoCmd.OpenReport
statement

FORMATTING IN AN EXPRESSION: vbCrLf forces a line break. Better is to use
separate text boxes for each line and set their "Can Shrink" property to
True. Make sure the text boxes don't overlap otherwise they will not
shrink.

VIEW: change your screen resolution. Or, select all the text boxes and
use
the "Align Left" option on the short cut (right click) menu.

Paul Martin said:
I ma trying to replicate from an earlier database the ability to print
individual records to my Dymo label printer and, at the same time, introduce
some improvements. So far this has prompted three questions i would be
grateful for some help with.

SINGLE LABEL
Despite copying most of the report from an earlier database I can't see what
property it is that makes it just print the current label.

In normal operation the report it called from a button placed on the form
and I only want it to printed fields from that current record.

What am I missing?

FORMATTING IN AN EXPRESSION

The name fields are group in a single text box with this expression
=([ContactTitle]+" ") & [ContactFirstName] & " " & [ContactLastName]

If I wanted to expand that expression so that all the fields for the report
were in a single text box, as has been suggested to me as a way of
suppressing empty fields, what character forces a line break?

VIEW
This is purely a cosmetic thing whilst trying to format my label but is
their a way to zoom in the view in design view? I am finding it
difficult
to
get all the text boxes lined up with its normal view.


Thanks in anticipation of help

Paul Martin
 

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