Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Validation Calc. help required

Featured Replies

I'm sure this is an easy one but...

I want to validate a field to accept only

00 or >10 and <50

(i.e. 00 or between 10 an 50)

I entered exactly as above but just got an error message

You have to explicitly mention the fieldname in the validation calculation. So if the field you are trying to validate is called Number, the validation field would be :D

Number=0 or (Number>10 and Number<50)

Regards,

Peter

Is this a number field or a text field?

For a number field try:

FieldName = 0 or (FieldName > 10 and FieldName < 50)

For a text field try:

FieldName = "00" or (FieldName > "10" and FieldName < "50")

FieldName is the field you are validating.

With a field called number.

Number > 9 and Number < 51 or Number = 0

And be sure to deselect the "Validate Only If Field Has Been Modified.

HTH

Lee

FieldName > "10" and FieldName < "50"

This will return true if FieldName = "100", for example.

Better make it

GetAsNumber ( FieldName ) > 10 and GetAsNumber ( FieldName ) < 50

  • Author

No joy here. I must be missing something.

The field is Area (Type number)

I have tried both suggestions, but entering for example 55, produces no error.

==============

Validation:

Only during data entry

Strict data type: Numeric

Strict validation

Maximum data length: 2

Error message: Out of Range

Calculation: Link :D:Area = 0 or (GetAsNumber ( Link :P:Area ) > 10 & GetAsNumber ( Link ::Area ) < 50

==============

This doesn't make sense.

Area codes have more than two numbers in the U.S., they are either 5 or 9 numbers.

Give is an example of the number you are using. or better yet, explain what you have now and what you want to happen. I have a feeling that somewhere along the line, something is being left out. The calculations given will work with what you described originally, as I test mine before posting.

Lee

Edited by Guest

Area may not mean Area Code. Regardless, validation will not happen until the User exits the field.

Oh. Forum was down and I couldn't get back. Your calc is wrong. And since we know it's number, try:

not Area or Area > 10 and Area < 50

Not & but and

Use Comment's instead. :grin:

Edited by Guest

If Area is a number field, GetAsNumber() is not required.

However, the syntax of your calculation is incorrect:

1."&" is a text concatenation operator - you need to use the "and" logical operator;

2. Link::Area is a related field - you need to refer to Area from the current table.

This is the correct formula:

Area = 0 or Area > 10 and Area < 50

---

"00" is not a number. Although Filemaker will accept such entry into a number field, and even remember it as such, its numeric value will nevertheless be 0.

Edited by Guest

  • Author

Lee

Nothing to do with US. The field is just reflecting geographical areas which someone has already decided on, and marked on a map. Area 10 might be a specified part of a town/city. Area 11 a different part of a town etc. The numbers that are used to represent these areas fall within the ranges I am trying to validate.

LaRetta

"validation will not happen until the User exits the field" or at all, at the moment

  • Author

1."&" is a text concatenation operator - you need to use the "and" logical operator :exactly:

Now WORKING. Thanks for all the help. It's appreciated.

John

Try validating by value list. I'm guessing these area numbers are all integers. So how long would it take for you to produce a custom value list of all the entries that you would like to be valid?

I see you now have it working OK so ignore my suggestion

Edited by Guest
Too late!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.