I have a similar set up in my database.
I made two calculation fields:
c_MonthYear = Date - Day ( Date ) + 1
c_MonthNAMEYear = MonthName ( Date ) & " " & Year ( Date )
and a global filter field to select the month:
Where Date is the name of your field with the date in.
Then made a Value List using values from fields the table: c_MonthYear & c_MonthNAMEYear
I then have pop-up menu showing values from my new Value List whis sets the global field g_FilterDate
and an OnObjectModify Script Trigger
That sets a variable $FilterDate
Shows all records
Performs find on ==$FilterDate
Then sorts the found set by date.
Hi, thanks for your comment. That's the approach I tried to implement before your replied.
But I am stucked now. I added pop-up menu with value list from field c_MonthNAMEYear. It is showing correct values but as I try to select different value it says "This field is not modifiable". I got script trigger on OnObjectModify so script couldn't be started.
Make sure the list isn't set to specify the Calculation fields, but the global field.
The list gets its values from the c_ fields, but, it needs to set a different field because it cannot modify the calculation.
If you right click the pop-up menu and then Specify Field, it should be set to the global field g_FilterDate.
Thanks a lot guys I finally managed to make it work!
Now I'm struggling with another thing connected to my problem. When user enter layout I wrote a script to show current months records but pop-up menu still remembers last selected value. I understand why, question is how to change global "variable" in my case Global::g_FilterDate. I tried to use Set variable function but it doesn't work.
Global::g_FilterDate is a global FIELD not a global VARIABLE so you would modify its value with Set Field.
Yes it's working now. I started using FileMaker week ago and I need to have my first app ready by the end of this week. This forum is really helping me to have it on time, hopefully I will. Thanks for your help.