Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Reports

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-08-2010, 06:39 AM
rbfarley rbfarley is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jan 2010
Posts: 3
rbfarley is on a distinguished road
Default Need Help with TRIM command

I have four fields (First_Name, MI, Last_Name, Suffix) that I am trying to trim so that they will appear without spaces on a report. When I do a combined string (=RTrim([First_Name])+" "+[MI]+" "+Trim([Last_Name])+" "+[Suffix]) I run into problems when any one of the fields is blank. Nothing will print. As long as all four fields contain data it will print. Problem is that only a few records have data in all four fields.

When I separate out the fields into four separate controls on the report, I cant get the TRIM function to work and there are spaces between the conrols.

Any idea? I think I am missing somehting simple here.

Thanks
Rob
Reply With Quote
  #2  
Old 01-08-2010, 07:05 AM
mastromb mastromb is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: Dec 2009
Location: Plymouth, MN
Posts: 37
mastromb is on a distinguished road
Default

Your function is erroring out because one of the fields is null. I can't say that I exactly know how to fix it because I have never used the trim function but I believe that is you problem.
Reply With Quote
  #3  
Old 01-08-2010, 07:31 AM
rbfarley rbfarley is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jan 2010
Posts: 3
rbfarley is on a distinguished road
Default TRIM command

I am aware of the null string. I need help dealing with the TRIM command with occasional null strings. Middle Initial is always one character so I don't use the TRIM command with this control, but when I add it to another control with the TRIM command such as First_Name I get a blank result when Middle Initial is not present. Unfortunately, not everyone has a middle initial or a suffix (Jr. Sr. etc.), but I have to include it in the name on this report if it is present.
Reply With Quote
  #4  
Old 01-08-2010, 11:03 AM
rbfarley rbfarley is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jan 2010
Posts: 3
rbfarley is on a distinguished road
Default All set.

I am all set now. Got a reply on a different forum. The key to this problem was to remove the TRIM command and change the operators from '+' to '&". I am not sure why it works, but it works and I am on my way. Thanks for everyone's help.

Rob
Reply With Quote
Reply

Bookmarks

Tags
reports, trim

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AddFromOutlook run command vappel Programming 0 12-17-2009 03:02 PM
Alterations to MsgBox command Robert M Programming 4 06-30-2009 12:14 PM
Command Button Help! arthura Programming 3 06-30-2009 10:55 AM
COPY DATA and TRIM Ed H Access 1 01-01-2009 04:01 AM
Trim JMantei Forms 1 06-20-2006 12:06 PM


All times are GMT -8. The time now is 10:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.