Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2005

Tip: Looking for answers? Try searching our database.

Shrink to avoid blank lines doesn't work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mogens - 28 Oct 2005 11:14 GMT
I have set the "can shrink" option to yes for a group of address fields,
and also grouped these fields. But the shrinking does not appear.

Are there any more options to set?
Jeff Boyce - 28 Oct 2005 12:42 GMT
If you have any controls on your report that are located to the right of the
field(s), they will not shrink.  I haven't tested the condition if the other
fields are to the left, but suspect the same is true.

Signature

Regards

Jeff Boyce
<Office/Access MVP>

> I have set the "can shrink" option to yes for a group of address fields,
> and also grouped these fields. But the shrinking does not appear.
>
> Are there any more options to set?
mogens - 28 Oct 2005 13:16 GMT
> If you have any controls on your report that are located to the right of the
> field(s), they will not shrink.  I haven't tested the condition if the other
> fields are to the left, but suspect the same is true.

In the layout I have to follow, the customer address is displayed left,
and the corresponding delivery address right. So I suppose this is the
explanation.

Not being a MS-access wizard, are there any possible fixes for this, as
for instance:
1)Concatenating the individual address lines in the query, and then
printing the entire address string. This would require a line break
character between the individual address elements. Does such a line
break character exist, and if positive, how is it generated?

2) Would it be a solution to put the fields inside another control and
circumvent the problem this way?
Jeff Boyce - 28 Oct 2005 15:09 GMT
You could concatenate the address string.  However, it would be up to you,
in how you concatenated the string, to eliminate the "blanks".  As far as I
know, having other controls at the same horizontal level as your "shrinking"
control basically acts to hold it open.

Signature

Regards

Jeff Boyce
<Office/Access MVP>

> > If you have any controls on your report that are located to the right of the
> > field(s), they will not shrink.  I haven't tested the condition if the other
[quoted text clipped - 13 lines]
> 2) Would it be a solution to put the fields inside another control and
> circumvent the problem this way?
BruceM - 28 Oct 2005 15:20 GMT
Concatenating will probably work for you.  Chr(13) & Chr(10) will accomplish
what amounts to a line break.  In query design view, create a concatenated
field by adding something like the following to the query design grid:

CombinedField: [FirstLineField] & Chr(13) & Chr(10) & [SecondLineField]

Bind a text box on the form to that field.  Set the text box just tall
enough for one line of text, and set its Can Grow property to Yes.  Set the
Can Grow property of the Detail section to Yes as needed.  Note that Chr(13)
& Chr(10) needs to be in that order.

You could do the same thing by setting the Control Source of an unbound text
box to:

= [FirstLineField] & Chr(13) & Chr(10) & [SecondLineField]

In VBA vbCrLf can substitute for Chr(13) & Chr(10).

If there is the chance of blank lines they can be eliminated with an IIf
statement.  Post back if you need details.

>> If you have any controls on your report that are located to the right of
>> the
[quoted text clipped - 15 lines]
> 2) Would it be a solution to put the fields inside another control and
> circumvent the problem this way?
mogens - 29 Oct 2005 10:33 GMT
> Concatenating will probably work for you.  Chr(13) & Chr(10) will accomplish
> what amounts to a line break.  In query design view, create a concatenated
[quoted text clipped - 16 lines]
> If there is the chance of blank lines they can be eliminated with an IIf
> statement.  Post back if you need details.

Bruce, this solved my problem nicely. I had to make some iif's but the
result is perfect.

However, I have another place where I need to convert som html code's
into something understandable for MS-access. For instance I have this
text string where I would like to convert the <BR>'s into linebreaks in
the report:

<BR>Bitte verwenden Sie folgende Daten für die Überweisung des
Gesamtbetrages.<BR>
Als Verwendungszweck geben Sie bitte Ihren Namen und Ihre Bestellnummer
an.<BR><BR>Konto: xxxxxxx

When I do a
pay_info:
IIf([payment_info]='';'';Replace([payment_info];"<BR>";"&Chr(13)&Chr(10)"))

this just results in that the codes are being printed out.
BruceM - 31 Oct 2005 13:34 GMT
If this is a one-time replacement you could probably use an Update Query.
If it is to be done continuously you would probably need some sort of
expression, but I am not aware of a Replace command.  Also, I am not
familiar with wildcards in expressions, but you may find what you need by
checking Using Wildcard Characters in String Comparisons in Help.  I do know
that anything enclosed in quotes in an IIf expression will be displayed as
exactly what appears between the quotes.  You could also try a Google groups
search.  I expect this question has been addressed from time to time.
If you seek an answer through the newsgroup you will probably do better to
start a new thread.

>> Concatenating will probably work for you.  Chr(13) & Chr(10) will
>> accomplish what amounts to a line break.  In query design view, create a
[quoted text clipped - 36 lines]
>
> this just results in that the codes are being printed out.
mogens - 31 Oct 2005 21:50 GMT
> If this is a one-time replacement you could probably use an Update Query.
> If it is to be done continuously you would probably need some sort of
[quoted text clipped - 6 lines]
> If you seek an answer through the newsgroup you will probably do better to
> start a new thread.

Thanks for your comments Bruce. I did of course investigate quite a lot,
but could not find a solution, and due to that this thread seemed to
have been "obsolete", I started a new thread.

Your reply would actually have done the trick, as I this evening found
out that the field in question was corrupted (some of the fields were
not <memo> but <NULL>), which caused errors. So the solution to this
problem, which need to be done continously, was to make a
replace([field];"<br>";Chr(13) & Chr(10)). Then it worked perfect.

Thanks for your help and concern. I have had a lot of good help in this
group. Makes life a lot easier for us newbies!

Mogens
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.