INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Concatenate, IsNull, Carriage Return

Concatenate, IsNull, Carriage Return

(OP)
1) How can I prevent the following from creating the extra line returns if the [PartComments] field is null?
2) How can I prevent the following from creating the extra line returns at the end if there is only one record?

Component Info: Concatenate("SELECT [Issue#] + ') ' & [PartName] & '; P/N: ' + [PartNbr] & '; TOW: ' + [PartTOW] & IIf(IsNull([PartUnsRemTY]),'', Chr(13) & Chr(10) & 'UNS RMVLS:' & Chr(13) & Chr(10) & " & Year([ExDate]) & " & ': ' & [PartUnsRemTY] & Chr(13) & Chr(10) & " & Format(DateAdd("yyyy",-1,[ExDate]),"yyyy") & " & ': ' & [PartUnsRemTY-1] & Chr(13) & Chr(10) & " & Format(DateAdd("yyyy",-2,[ExDate]),"yyyy") & " & ': ' & [PartUnsRemTY-2])& Chr(13) & Chr(10) & Chr(13) & Chr(10) & UCase([PartComments]) FROM tblCompAnal WHERE ExHistID = '" & [ExHistID] & "'",Chr(13) & Chr(10) & Chr(13) & Chr(10))

Thank you!!

RE: Concatenate, IsNull, Carriage Return

You can experiment with replacing some & with +. For instance:

[FirstName] + Chr(10) + Chr(13) + [LastName] will return Null if either FirstName or LastName is null.

Duane
Hook'D on Access
MS Access MVP

RE: Concatenate, IsNull, Carriage Return

(OP)

Duane,

Issue #1 was resolved by using your suggestion, thank you...

Component Info: Concatenate("SELECT [Issue#] + ') ' & [PartName] & '; P/N: ' + [PartNbr] & '; TOW: ' + [PartTOW] & IIf(IsNull([PartUnsRemTY]),'', Chr(13) & Chr(10) & 'UNS RMVLS:' & Chr(13) & Chr(10) & " & Year([ExDate]) & " & ': ' & [PartUnsRemTY] & Chr(13) & Chr(10) & " & Format(DateAdd("yyyy",-1,[ExDate]),"yyyy") & " & ': ' & [PartUnsRemTY-1] & Chr(13) & Chr(10) & " & Format(DateAdd("yyyy",-2,[ExDate]),"yyyy") & " & ': ' & [PartUnsRemTY-2])& Chr(13) & Chr(10) + Chr(13) + Chr(10) + UCase([PartComments]) FROM tblCompAnal WHERE ExHistID = '" & [ExHistID] & "'",Chr(13) & Chr(10) & Chr(13) & Chr(10))

Do you have a suggestion for issue #2?

RE: Concatenate, IsNull, Carriage Return

You may need to modify the concatenate function. I don't have the time right now but it could be a matter of trimming off some ending characters.

Duane
Hook'D on Access
MS Access MVP

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close