strido Posted September 1, 2011 Share Posted September 1, 2011 So here's the deal. Every week the client sends a new data file with a new problem, apparently to keep me on my toes. This week's fun is as follows: Recipient's first name has several empty fields. Somewhere in the text appears this paragraph: Steve, may I suggest you look into financial....mumbo....jumbo...etc..etc.. "Steve" is a rule, to force it to proper case. The remainder of the paragraph is typeset into the text box. Now, when the recipient's name comes in with their data file empty, it looks pretty crappy: , may I suggest you look into more mumbo jumbo...etc..etc.... It's all well and good to just create a rule (and by create, I mean copy an existing one) that will remove that comma. But this presents a problem with the word "may". If I create a rule that says to remove the comma, and insert the capitalized version of the word "may", that's cool - but the next record will wind up being populated, so it'll say: "Steve, May may I suggest..." This is what I have so far: var Var1 = "RecipientFirstName"; firstName = Field(Var1); if (Trim(firstName) == "" ){ return ""; } return ToTitleCase(Trim( '' + Field(Var1) + ",")); So the question would be, how could I remove the word "may" from the textbox in the event the field IS populated, yet keep it there for when it's not? Link to comment Share on other sites More sharing options...
esmith Posted September 1, 2011 Share Posted September 1, 2011 var Var1 = "RecipientFirstName"; firstName = Field(Var1); if (Trim(firstName) == "" ){ return "May "; } return ToTitleCase(Trim( '' + Field(Var1))) + ", may "; Remove " may " from your text frame. Link to comment Share on other sites More sharing options...
strido Posted September 1, 2011 Author Share Posted September 1, 2011 Wow. Just missed it! thanks - works like a charm! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.