![]() |
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
|
| Bookmarks |
| Tags |
| reports, trim |
| Thread Tools | |
| Display Modes | |
|
|
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 |