Jump to content

Field Validation


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

Recommended Posts

I'm trying to validate a date entered into a date field is the last day of the month. In the validate by calculation box I typed:

Month (Period Date A + 1) [not equal symbol] Month ( Period Date A)

Period Date A is the field I am validating. Would'nt the above statement only be true for any date that is the last day of the month. Does anyone know why this is not working. I could not type the "not equal sysmbol" so I wrote it out above.

Link to comment
Share on other sites

Thanks for responding. I am having no such luck with FMP7. I just tried this in FMP6 and it works fine. I neglected to tell you that the field I am validating has been set to global. I wonder if this has something to do with it.

Link to comment
Share on other sites

Why exactly are you validating the global? Are users entering the date? If so, why not just Set Field [gdate, Date( Month(gdate) + 1; 0; Year(gdate) )]?

This will set it with the last day of the month for whatever date they enter.

I often use a global text field in these cases, so that a script doesn't error if they enter an invalid date. Then I test If [Length(gtext) and IsValid(GetAsDate(gtext))] continue, otherwise Show Message ["Please enter a valid date."]

Link to comment
Share on other sites

I just discovered that the validation calculation works just fine when the global field box is not checked. As soon as you check it, it does not validate as expected. Can anyone confirm this. By the way, one is supposed to be able to validate by calculation a global field, right?

Link to comment
Share on other sites

It appears to only validate after data has already been entered. When you attempt to modify it, then it warns you. I wonder if this was fixed in the update.

Link to comment
Share on other sites

Users are filling in this date to run a report where the last day of the month only makes sense. Thank you for your suggestion. Instead of validating the field I will just set it to the last day of the month for the date entered.

Link to comment
Share on other sites

This topic is 6439 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.