Jump 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.

Validating Year in a date field

Featured Replies

Looking through the threads I've seen this asked in similar ways so forgive this question. I have a field where I want the user to enter the "year" only. Not "2/21/2003". I tried formating the fields to show only the year, but fm asks for the user to enter the complete date. I could set the field as a number or date field, but I'm afraid that might cause validation problems down the road when I'll have to sort on the field. Is there a message box that could be used to prompt the user? I'm very new to fm and would appreciate any guidence on this issue.

Why not have your users input the year into a number field instead of a date field?

HTH, Mike

I would recommend a Text field instead. That way you can easily use the TexttoDate function to convert it to a date (part of anyway) if need in the future. Otherwise you would have to first convert it to text and then to date.

Lee

Lee,

You're right, a text field would be better.

Mike

Hi Tmonk,

It appears as though you are trying to 'foolproof' your data entry for the user... always an important issue when designing a good user interface. You could do this a number of ways...

- a date field with 'validation' to verify as a legal entry

- separate fields (text or number) for day, month, year... use a calculation to combine into a final date field

- pull-down menus with only the appropriate items (text or number) as a choice... use a calculation to combine into a final date field

- create a 'datelist' file with only available dates to choose from... then a relation to display those dates

As you can see... you are only limited by your imagination as to how to apply a solution to your issue. The list above gives you some ideas... there are many more. The ideas I've listed above include basic interface & simple implementation as well as complex implementations and highly functional interface designs.

As a new FMP developer, I would recommend starting with a simple solutions first, then 'challenge' yourself to learn how to apply the other ideas to your issue... you will amaze yourself as you learn new tricks and ways to accomplish things within FileMaker.

Let me know if you need help... I could create a simple sample file to show you a few of the ideas above.

Good Luck!

Bob Kundinger

[email protected]

Create an account or sign in to comment

Important Information

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

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.