Please Help

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

I have a unbound text box that has two variables being read in that are
hidden on the same page. I need to have a seperate line between each value.
Here is the current code:

= [txtStatus] & " " & [txtTitle}

I would like the status to appear if there is status info. If not then go
onto the Title info. If both are there I need to have them appear on
seperate lines, ie:

Status
Title

Thanks,

Tony
 
Have 2 unbound text boxes one =[txtStatus] and the other =[txtTitle].
Please them out the way you want to...

=[txtStatus]
=[txtTitle]

In the properties for the =[txtStatus], on Format, turn Can Shrink ON and
that should do it.
 
Try this Control Source instead of what you have now:

= ([Status] + Chr$(13) + Chr$(10)) & [Title]

If [Status] is Null, then the first part, including the Chr$(13) and
Chr$(10) which in that order make up a carriage return - line feed pair,
will vanish and Title will appear on the first line. If Status is not Null,
it will appear, be followed by a cr-lf, and then Title will be on the next
line. That is:

Null + something yields Null
Null & something yields something

And, if the explanation confuses more than explains, just try the code. <G>

Larry Linson
Microsoft Access MVP
 
Thank you for the reply. However i found that the code that you offered
still places title even when there is no title.
Do i use the same format for Title that i did for status?

Thanks,
Tony




Larry Linson said:
Try this Control Source instead of what you have now:

= ([Status] + Chr$(13) + Chr$(10)) & [Title]

If [Status] is Null, then the first part, including the Chr$(13) and
Chr$(10) which in that order make up a carriage return - line feed pair,
will vanish and Title will appear on the first line. If Status is not Null,
it will appear, be followed by a cr-lf, and then Title will be on the next
line. That is:

Null + something yields Null
Null & something yields something

And, if the explanation confuses more than explains, just try the code.
Larry Linson
Microsoft Access MVP


Tony said:
I have a unbound text box that has two variables being read in that are
hidden on the same page. I need to have a seperate line between each value.
Here is the current code:

= [txtStatus] & " " & [txtTitle}

I would like the status to appear if there is status info. If not then go
onto the Title info. If both are there I need to have them appear on
seperate lines, ie:

Status
Title

Thanks,

Tony
 
Back
Top