Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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!

Posted

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

Posted

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

Posted

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.

Posted

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.

This topic is 6638 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
×
×
  • Create New...

Important Information

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