Textbox Formatting

G

Guest

I have a textbox on a report with the following:

="1: " & [Provision1] & IIf([Provision2] Is Not Null,Chr(13) &
Chr(10) & "2: " & [Provision2],"") & IIf([Provision3] Is Not
Null,Chr(13) & Chr(10) & "3: " & [Provision3],"") &
IIf([Provision4] Is Not Null,Chr(13) & Chr(10) & "4: " &
[Provision4],"")

This works perfect, except when one of the provisions goes to the next line
on the report it starts back underneath the number, instead of indenting back
underneath the provision. I hope this makes sense. Also, surely there is a
better way for me to tell it to indent other than just putting the spaces,
right?

Any help is appreciated.
Thanks.
 
F

fredg

I have a textbox on a report with the following:

="1: " & [Provision1] & IIf([Provision2] Is Not Null,Chr(13) &
Chr(10) & "2: " & [Provision2],"") & IIf([Provision3] Is Not
Null,Chr(13) & Chr(10) & "3: " & [Provision3],"") &
IIf([Provision4] Is Not Null,Chr(13) & Chr(10) & "4: " &
[Provision4],"")

This works perfect, except when one of the provisions goes to the next line
on the report it starts back underneath the number, instead of indenting back
underneath the provision. I hope this makes sense. Also, surely there is a
better way for me to tell it to indent other than just putting the spaces,
right?

Any help is appreciated.
Thanks.

Wrong!
You'll have to include spaces along with the chr(13) & chr(10).

="1: " & [Provision1] & IIf([Provision2] Is Not
Null,Chr(13) & chr(10) & space(10) & etc.....

Change space(10) to whatever the actual number of spaces should be to
align properly.
 
J

John Spencer

Better solution might be to add controls for the each number and for
each Provision field. Then align the number controls as desired and all
the provision controls. Then use can grow and can shrink on the
provision controls and code to show hide the number controls as appropriate.

Control Layout
[txtNum1] [Provision1]
[txtNum2] [Provision2]
[txtNum3] [Provision3]
[txtNum4] [Provision4]

In the section's format event you would have code like

Me.TxtNum1.Visible = Len(me.Provision1 & "") >0
Me.TxtNum2.Visible = Len(me.Provision2 & "") >0
....


Print Layout if Provision 3 requires multiple lines and Provision4 is null
[txtNum1] [Provision1]
[txtNum2] [Provision2]
[txtNum3] [Provision3] First Line
[Provision3] Second line

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I have a textbox on a report with the following:

="1: " & [Provision1] & IIf([Provision2] Is Not Null,Chr(13) &
Chr(10) & "2: " & [Provision2],"") & IIf([Provision3] Is Not
Null,Chr(13) & Chr(10) & "3: " & [Provision3],"") &
IIf([Provision4] Is Not Null,Chr(13) & Chr(10) & "4: " &
[Provision4],"")

This works perfect, except when one of the provisions goes to the next line
on the report it starts back underneath the number, instead of indenting back
underneath the provision. I hope this makes sense. Also, surely there is a
better way for me to tell it to indent other than just putting the spaces,
right?

Any help is appreciated.
Thanks.

Wrong!
You'll have to include spaces along with the chr(13) & chr(10).

="1: " & [Provision1] & IIf([Provision2] Is Not
Null,Chr(13) & chr(10) & space(10) & etc.....

Change space(10) to whatever the actual number of spaces should be to
align properly.
 
G

Guest

That's what I've been trying to do. Thanks a bunch.

John Spencer said:
Better solution might be to add controls for the each number and for
each Provision field. Then align the number controls as desired and all
the provision controls. Then use can grow and can shrink on the
provision controls and code to show hide the number controls as appropriate.

Control Layout
[txtNum1] [Provision1]
[txtNum2] [Provision2]
[txtNum3] [Provision3]
[txtNum4] [Provision4]

In the section's format event you would have code like

Me.TxtNum1.Visible = Len(me.Provision1 & "") >0
Me.TxtNum2.Visible = Len(me.Provision2 & "") >0
....


Print Layout if Provision 3 requires multiple lines and Provision4 is null
[txtNum1] [Provision1]
[txtNum2] [Provision2]
[txtNum3] [Provision3] First Line
[Provision3] Second line

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I have a textbox on a report with the following:

="1: " & [Provision1] & IIf([Provision2] Is Not Null,Chr(13) &
Chr(10) & "2: " & [Provision2],"") & IIf([Provision3] Is Not
Null,Chr(13) & Chr(10) & "3: " & [Provision3],"") &
IIf([Provision4] Is Not Null,Chr(13) & Chr(10) & "4: " &
[Provision4],"")

This works perfect, except when one of the provisions goes to the next line
on the report it starts back underneath the number, instead of indenting back
underneath the provision. I hope this makes sense. Also, surely there is a
better way for me to tell it to indent other than just putting the spaces,
right?

Any help is appreciated.
Thanks.

Wrong!
You'll have to include spaces along with the chr(13) & chr(10).

="1: " & [Provision1] & IIf([Provision2] Is Not
Null,Chr(13) & chr(10) & space(10) & etc.....

Change space(10) to whatever the actual number of spaces should be to
align properly.
 

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