Alignment

G

Guest

I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the variable lengths
of the Names. Can the Code be adjusted so that the Ages will always Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) & Trim([Name of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child 3] & ("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & (" "+[Expr6]))

Thanks for any help
 
D

Duane Hookom

You should really normalize your table structure so that each child creates
a "child" record in a related table. You could then use a subreport to
properly display the children the what are apparently ages (Expr1, Expr2,
Expr3,...)

You could use a union query to normalize your table.
 
G

Guest

Thanks.
So there is no way I can use Ltrim for Eg before Expr1 etc


Duane Hookom said:
You should really normalize your table structure so that each child creates
a "child" record in a related table. You could then use a subreport to
properly display the children the what are apparently ages (Expr1, Expr2,
Expr3,...)

You could use a union query to normalize your table.
--
Duane Hookom
MS Access MVP

Roger Bell said:
I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the variable
lengths
of the Names. Can the Code be adjusted so that the Ages will always Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) & Trim([Name of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child 3] & ("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & (" "+[Expr6]))

Thanks for any help
 
D

Duane Hookom

Apparently you don't want to normalize your table structure. You might be
able to use a fixed space font to get the columns to line up. Otherwise
consider making two text boxes, one for the names of the children and the
other for the ages.

--
Duane Hookom
MS Access MVP

Roger Bell said:
Thanks.
So there is no way I can use Ltrim for Eg before Expr1 etc


Duane Hookom said:
You should really normalize your table structure so that each child
creates
a "child" record in a related table. You could then use a subreport to
properly display the children the what are apparently ages (Expr1, Expr2,
Expr3,...)

You could use a union query to normalize your table.
--
Duane Hookom
MS Access MVP

Roger Bell said:
I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the variable
lengths
of the Names. Can the Code be adjusted so that the Ages will always
Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) & Trim([Name
of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child 3] &
("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & (" "+[Expr6]))

Thanks for any help
 
G

Guest

Thanks Duane for your valuable time. Could you tell me how a would use a
fixed space font.
I am very grateful as I inherited this data base and realise the importance
of Normalization, however, I am forced to run with it for now.


Duane Hookom said:
Apparently you don't want to normalize your table structure. You might be
able to use a fixed space font to get the columns to line up. Otherwise
consider making two text boxes, one for the names of the children and the
other for the ages.

--
Duane Hookom
MS Access MVP

Roger Bell said:
Thanks.
So there is no way I can use Ltrim for Eg before Expr1 etc


Duane Hookom said:
You should really normalize your table structure so that each child
creates
a "child" record in a related table. You could then use a subreport to
properly display the children the what are apparently ages (Expr1, Expr2,
Expr3,...)

You could use a union query to normalize your table.
--
Duane Hookom
MS Access MVP

I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the variable
lengths
of the Names. Can the Code be adjusted so that the Ages will always
Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) & Trim([Name
of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child 3] &
("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & (" "+[Expr6]))

Thanks for any help
 
D

Duane Hookom

Change the font of the text box to "Courier New". Then change your
expression to pad the fields like
=Left([Name of Child 1] & Space(20) ,20) + [Expr1] + Chr(13)+Chr(10) &
Left([Name of Child 2] & Space(20) ,20)...

I would still use a subreport based on a union query.


--
Duane Hookom
MS Access MVP


Roger Bell said:
Thanks Duane for your valuable time. Could you tell me how a would use a
fixed space font.
I am very grateful as I inherited this data base and realise the
importance
of Normalization, however, I am forced to run with it for now.


Duane Hookom said:
Apparently you don't want to normalize your table structure. You might be
able to use a fixed space font to get the columns to line up. Otherwise
consider making two text boxes, one for the names of the children and the
other for the ages.

--
Duane Hookom
MS Access MVP

Roger Bell said:
Thanks.
So there is no way I can use Ltrim for Eg before Expr1 etc


:

You should really normalize your table structure so that each child
creates
a "child" record in a related table. You could then use a subreport to
properly display the children the what are apparently ages (Expr1,
Expr2,
Expr3,...)

You could use a union query to normalize your table.
--
Duane Hookom
MS Access MVP

I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the variable
lengths
of the Names. Can the Code be adjusted so that the Ages will always
Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) &
Trim([Name
of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child 3]
&
("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & ("
"+[Expr6]))

Thanks for any help
 
G

Guest

Thanks again Duane. That has worked thanks to you. Only problem is that if
there is no Age shown for a child, the next child's name comes up a line to
the age area.

Could there be something wrong with my code?

=Left([Name of Child 1] & Space(26),26)+[Expr1]+Chr(13)+Chr(10) & Left([Name
of Child 2] & Space(26),26)+([Expr2]+Chr(13)+Chr(10) & Left([Name of Child 3]
& Space(26),26)+[Expr3]+Chr(13)+Chr(10) & Left([Name of Child 4] &
Space(26),26)+[Expr4]+Chr(13)+Chr(10) & Left([Name of Child 5] &
Space(26),26)+([Expr5]+Chr(13)+Chr(10) & Left([Name of Child 6] &
Space(26),26)+[Expr6]))

Thanks again

Duane Hookom said:
Change the font of the text box to "Courier New". Then change your
expression to pad the fields like
=Left([Name of Child 1] & Space(20) ,20) + [Expr1] + Chr(13)+Chr(10) &
Left([Name of Child 2] & Space(20) ,20)...

I would still use a subreport based on a union query.


--
Duane Hookom
MS Access MVP


Roger Bell said:
Thanks Duane for your valuable time. Could you tell me how a would use a
fixed space font.
I am very grateful as I inherited this data base and realise the
importance
of Normalization, however, I am forced to run with it for now.


Duane Hookom said:
Apparently you don't want to normalize your table structure. You might be
able to use a fixed space font to get the columns to line up. Otherwise
consider making two text boxes, one for the names of the children and the
other for the ages.

--
Duane Hookom
MS Access MVP

Thanks.
So there is no way I can use Ltrim for Eg before Expr1 etc


:

You should really normalize your table structure so that each child
creates
a "child" record in a related table. You could then use a subreport to
properly display the children the what are apparently ages (Expr1,
Expr2,
Expr3,...)

You could use a union query to normalize your table.
--
Duane Hookom
MS Access MVP

I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the variable
lengths
of the Names. Can the Code be adjusted so that the Ages will always
Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) &
Trim([Name
of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child 3]
&
("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & ("
"+[Expr6]))

Thanks for any help
 
D

Duane Hookom

Do you understand the difference between using & or + for concatenation? The
+ will propogate a null so if Expr1 is null then Chr(13) + Chr(10) become
null also. You may want to replace some + with & especially preceding
Chr(13) & Chr(10).

--
Duane Hookom
MS Access MVP


Roger Bell said:
Thanks again Duane. That has worked thanks to you. Only problem is that
if
there is no Age shown for a child, the next child's name comes up a line
to
the age area.

Could there be something wrong with my code?

=Left([Name of Child 1] & Space(26),26)+[Expr1]+Chr(13)+Chr(10) &
Left([Name
of Child 2] & Space(26),26)+([Expr2]+Chr(13)+Chr(10) & Left([Name of Child
3]
& Space(26),26)+[Expr3]+Chr(13)+Chr(10) & Left([Name of Child 4] &
Space(26),26)+[Expr4]+Chr(13)+Chr(10) & Left([Name of Child 5] &
Space(26),26)+([Expr5]+Chr(13)+Chr(10) & Left([Name of Child 6] &
Space(26),26)+[Expr6]))

Thanks again

Duane Hookom said:
Change the font of the text box to "Courier New". Then change your
expression to pad the fields like
=Left([Name of Child 1] & Space(20) ,20) + [Expr1] + Chr(13)+Chr(10) &
Left([Name of Child 2] & Space(20) ,20)...

I would still use a subreport based on a union query.


--
Duane Hookom
MS Access MVP


Roger Bell said:
Thanks Duane for your valuable time. Could you tell me how a would use
a
fixed space font.
I am very grateful as I inherited this data base and realise the
importance
of Normalization, however, I am forced to run with it for now.


:

Apparently you don't want to normalize your table structure. You might
be
able to use a fixed space font to get the columns to line up.
Otherwise
consider making two text boxes, one for the names of the children and
the
other for the ages.

--
Duane Hookom
MS Access MVP

Thanks.
So there is no way I can use Ltrim for Eg before Expr1 etc


:

You should really normalize your table structure so that each child
creates
a "child" record in a related table. You could then use a subreport
to
properly display the children the what are apparently ages (Expr1,
Expr2,
Expr3,...)

You could use a union query to normalize your table.
--
Duane Hookom
MS Access MVP

I have used the following code in a Text Box, which works OK.
However, the Ages do not line up to the left, caused by the
variable
lengths
of the Names. Can the Code be adjusted so that the Ages will
always
Left
Align?

=Trim([Name of Child 1] & (" "+[Expr1]))+Chr(13)+Chr(10) &
Trim([Name
of
Child 2] & (" "+[Expr2]))+Chr(13)+Chr(10) & Trim([Name of Child
3]
&
("
"+[Expr3]))+Chr(13)+Chr(10) & Trim([Name of Child 4] & ("
"+[Expr4]))+Chr(13)+Chr(10) & Trim([Name of Child 5] & ("
"+[Expr5]))+Chr(13)+Chr(10) & Trim([Name of Child 6] & ("
"+[Expr6]))

Thanks for any 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