WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
A READER ASKS
In a database with posts of several years/months/dates I would like to insert a month number (1-12) in a field in search mode and when leaving the field Filemaker would search, find and sort all posts of that month.
I have created a field that gets the month number out of a date - if the date is of the current year. You might say that all I want is to abolish hitting the return key, but then again searching for the simplest solution is always a challenge...
-------
DWAYNE RESPONDS
Well, you can perform a search on a field by only entering in the month and year with a separator. So you can ...
- go into find mode
- type 10/2008 in a date field
and it will find all the records for the month of October 2008. However, it is hard to script a search in a date field unless you put in actual date information.

So I cooked up an example file that is a bit of a blend of two other examples I’ve uploaded EXAMPLE: Formatting A Range Between Two Dates and EXAMPLE: Calculate Last Day Of The Month.
The script brings up a custom dialog box that allows you to enter in a month and year value into some global fields. When you execute the Show Custom Dialog box (by clicking the OK button), the script goes into find mode, sets the date field equal to the start and end date of the month / year indicated and performs the find. Now, there is a number of other things you will likely want to add to this script but this should get you started!
An example file can be downloaded at ...
http://www.dwaynewright.com/blogfiles08/MonthYearSearch.zip
=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.
© 2008 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

0 comments:
Post a Comment