November 21, 200619 yr I want to set up a validation by calculation that will check to see if the user has entered a comma in a text field. I'm having no luck doing this.. can it be done? If so can someone help me out here? Thanks!
November 21, 200619 yr You can have an Auto-Enter calculation on the text field. Be sure to uncheck 'Do Not Replace Existing Value for Field...). The calculation would be simple: Substitute ( thisField ; "," ; "" ) This will simply remove them. Why bother a User with a validation error when FM is bright enough just to zap those commas from the universe? LaRetta
November 21, 200619 yr Hi, What you want to do if a comma is found will dictate which way is best. However, the patterncount function can be used to count the # of commas, the position function can be used to tell where in the string the comma occurs, the replace function or the substitute function can be used to replace the comma with a space. If you do not want to allow a comma to be entered then place this calculation in the validate by calculation .... If not (patterncount(fieldname,",")) Should do the trick. Hope this helps, Tim
November 21, 200619 yr I concur with Laretta that you should just use a substitute to remove those commas. Once the field becomes comma free then you can use the number formatting option to allow commas for diplay purposes.
November 21, 200619 yr Author Awesome guys. I figured the substitute thing out from a quick search on yahoo. Works great. I swapped the comma for a dash. Figure it would serve the same purpose.
Create an account or sign in to comment