Jump to content

How to make sure there's no commas in a text field?


This topic is 5798 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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? :wink2:

LaRetta

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5798 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.