Centering

N

Novice2000

Hi,

I have inherited a report, which works, but the title field at the top is
not always centered even though it is set to be centered. Is there any
reason why some of the data is centered and some appears to be further to the
left? Thanks
 
F

fredg

Hi,

I have inherited a report, which works, but the title field at the top is
not always centered even though it is set to be centered. Is there any
reason why some of the data is centered and some appears to be further to the
left? Thanks

It's most likely centered within the control (that's what center align
does), but the control is not centered on the report.
Set the report width to the full width of the paper to be used to
print out, less the width of the margins.
Then set your title control at the report left margin and size it to
the right side of the report.
Now, if the control's alignment property is centered, it should always
be centered on the report.
 
N

Novice2000

Thanks I still need help though.

Set the report width to the full width of the paper to be used to
print out, less the width of the margins. It is

Then set your title control at the report left margin and size it to
the right side of the report. What??
 
F

fredg

Thanks I still need help though.

Set the report width to the full width of the paper to be used to
print out, less the width of the margins. It is

Then set your title control at the report left margin and size it to
the right side of the report. What??

1) set your title control at the report left margin ....

With the control selected move the cursor over the control until the
cursor becomes a hand. Left-click and drag the control to the left
side of the report.

Alternatively, with the control's property sheet displayed, set the
control's Left property to 0 (on it's property sheet's Format tab).

2) ... and size it to the right side of the report.
With the control selected, move the cursor over the little square
block that appear midway down the right side of the control border.
The cursor will turn into a 2-way arrow. Left-click and drag the right
side of the control over to the right edge of the report.

Alternatively, while the property sheet is displayed, set the
control's Width property to whatever the Width of the report is.
 
N

Novice2000

Hi fredg,

I had it on zero, and I had it set to 6.5. This data is through the SQL
Server to another database maintained by another company. This is a different
sort of problem. This is what I discovered and what I emailed to the person
maintaining the other database and his response.

Hi Mike,

I was pulling my hair out (as usual) trying to get the company name (Comp)
lined up in the center of the top of a report I am creating. The source of
the data is (his database). Some of the company names were centered, but some
were over to the left.

After trying everything that I could with Access, I discovered that the
titles that wouldn't center were not centered in (his database). There were
spaces behind them in the Company Name field. If I place my cursor at the end
of the company name and press delete for a while, this removes these extra
spaces. This is a time-consuming thing. Is there any way you can remove the
extra spaces behind the Company names?

His answer was: There is no way to guarantee that there will never be spaces
in the name so you are going to have to find an Access method to remove the
spaces in your report.

So, the question is is there a way to remove these spaces in the report,
since this is not my table that I maintain? Thanks
 
F

fredg

Hi fredg,

I had it on zero, and I had it set to 6.5. This data is through the SQL
Server to another database maintained by another company. This is a different
sort of problem. This is what I discovered and what I emailed to the person
maintaining the other database and his response.

Hi Mike,

I was pulling my hair out (as usual) trying to get the company name (Comp)
lined up in the center of the top of a report I am creating. The source of
the data is (his database). Some of the company names were centered, but some
were over to the left.

After trying everything that I could with Access, I discovered that the
titles that wouldn't center were not centered in (his database). There were
spaces behind them in the Company Name field. If I place my cursor at the end
of the company name and press delete for a while, this removes these extra
spaces. This is a time-consuming thing. Is there any way you can remove the
extra spaces behind the Company names?

His answer was: There is no way to guarantee that there will never be spaces
in the name so you are going to have to find an Access method to remove the
spaces in your report.

So, the question is is there a way to remove these spaces in the report,
since this is not my table that I maintain? Thanks

So the control is a text control, not a label control.
Size the text control as previously suggested.
Instead of having the control source set to [Comp], set the control
source to:

=Trim([Comp])

Make sure the NAME of this control is NOT "Comp". If it is, just
change the name to something else, i.e. "txtComp".

The Trim function removes all preceding and trailing spaces.
Look up Trim, LTrim, and RTrim in VBA help.
 
N

Novice2000

That did it. Thank you very much

fredg said:
Hi fredg,

I had it on zero, and I had it set to 6.5. This data is through the SQL
Server to another database maintained by another company. This is a different
sort of problem. This is what I discovered and what I emailed to the person
maintaining the other database and his response.

Hi Mike,

I was pulling my hair out (as usual) trying to get the company name (Comp)
lined up in the center of the top of a report I am creating. The source of
the data is (his database). Some of the company names were centered, but some
were over to the left.

After trying everything that I could with Access, I discovered that the
titles that wouldn't center were not centered in (his database). There were
spaces behind them in the Company Name field. If I place my cursor at the end
of the company name and press delete for a while, this removes these extra
spaces. This is a time-consuming thing. Is there any way you can remove the
extra spaces behind the Company names?

His answer was: There is no way to guarantee that there will never be spaces
in the name so you are going to have to find an Access method to remove the
spaces in your report.

So, the question is is there a way to remove these spaces in the report,
since this is not my table that I maintain? Thanks

So the control is a text control, not a label control.
Size the text control as previously suggested.
Instead of having the control source set to [Comp], set the control
source to:

=Trim([Comp])

Make sure the NAME of this control is NOT "Comp". If it is, just
change the name to something else, i.e. "txtComp".

The Trim function removes all preceding and trailing spaces.
Look up Trim, LTrim, and RTrim in VBA help.
 

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