Jump to content

Rule for adding Suite


billn

Recommended Posts

billn;

 

Try this one.

 
if (Trim(Field("yourfield")) != "")  {
   if (StringToNumber(Field("yourfield")))  {
       return "Suite " + Field("yourfield")
   }
   else  {
       return Field("yourfield");
   }
}
else  {
   return "";
}

 

If your specified field is blank, it will return a blank that you can suppress within the text box parameters. If the entry is "purely" a numeric string it will return the word "Suite " then the number. But if there are any non-numeric characters in your specified field, it will simply return what is in the field. I'm assuming here that sometimes your field will contain a blank, be filled in with just the suite number, or possible be filled in with the word "suite", "apt", "dept" or something else like that.

 

BIG CAVEAT: This will work for the above situation only, but NOT if the suite designation is an actual letter such as "Suite A" where the letter "A" is what was entered in the field.

 

I don't know if you want to do a simple "if nothing is there return nothing, but if something is there put the word Suite in front of it" kind of rule if there is any possibility of the data field containing the words suite, apt or dept in it. You would have a return value of something like "Suite Dept 123" or "Suite suite B1".

 

If there is NO CHANCE of anything but the suite designation number/letter being in that field, then you could do someting like...

 
if (Trim(Field("yourfield")) != "")  {
   return "Suite " + Field("yourfield")
}
else  {
   return "";
}

 

Good Luck

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...