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.

find birthday at file opening

Featured Replies

Dear All,

I have searched for this in the Forum and have also found some solutions but it was for fmp7 and I guess I can't use the same syntax for my script in fmp5.

Here's what I'd like to do: at opening of the databse I want to assign a script (at edit/prefs/document...) that runs and finds the birthday of somebody - but one day before his actual birthday, so I can send him a card or email etc. I have tried to calculate my field DOB in the script, set field to ... etc etc but haven't gotten to the proper syntax - I give up!

Thanks for your help...

Andy

The calc would be:

Day ( DOB ) = Day ( Status (CurrentDate) + 1 )

and

Month ( DOB ) = Month ( Status (CurrentDate) + 1 )

You could put this in a calc field cBirthday (result is number, unstored) and find records where cBirthday = 1.

Or, you could add a field cBirthday (result is text, stored) =

Month ( DOB ) & "|" & Day ( DOB )

Then in your find script go to Find mode and set field cBirthday to:

Month ( Status (CurrentDate) + 1 ) & "|" & Day ( Status (CurrentDate) + 1 )

--- EDIT ---

I am afraid I don't have an elegant solution for those who have been born on February 29. Let me think...

How about an unstored calc field of Date( Month(DOB), Day(DOB), Year(Status(CurrentDate)) ) - 1 ? Then you can perform a find for today's date in it. Unless you have thousands of records, this shouldn't be too slow.

  • Author

Thank you guys, I have adopted Queue's version, it works fine and it looked a little simpler to me right now but I will play around with comment's example as well just for the heck of it...

Thanks again...

  • Author

One more thing in regards to this: if my scsript doesn't find a birthday, is there a way to eliminate the error message "no matching records found"? It might confuse my users a little if the message pops up every day.

Thanks,

Andy

At the beginning of your script use Set Error Capture on. This will remove the error message, but you now must tell FMP (in your script) what to do if there are no found records.

  • Author

Thank you Ralph, that'll help...

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.