I guess I'd simply allow the user to type in the start and end date into global fields and then use those fields in your find script. Let's say you have the two globals: DateStart_g, DateEnd_g
1/1/2016 for DateStart_g
12/12/2016 for DateEnd_g
Enter Find Mode
Set field [ YourTable::DateField] DateStart_g &"…" &DateEnd_g //This does an inclusive search of the entire date range.
Make sure the global fields are editable (Inspector / data tab).
Let me know if you'd like to see an example, or if I'm misreading what you're asking.
There are a couple parts to getting this to work the way you want to :
Permissions--make sure the user has the ability to edit the field.
Layout--ensure the field can be entered in browse mode.
Use global date fields--This will be important if you end up having multiple users at some point. (NO calculations or auto-enters)
Script--You will want to set the field using a script .
File Script Triggers--You will want to call the script from OnFirstWindowOpen in the File Options
The goal is to end up with a script that runs when you open the file that sets the global fields to the date that you want. It sounds like it is a bit trickier because you don't want to set the to and from fields to a specific data range (30 days) but rather to a day of the Week (Sunday). So you will need a calculation that is something like this to return the previous Sunday:
Get(CurrentDate) - (DayofWeek(Get(CurrentDate)-1)
Best of Luck!
Thanks for the responses, I found that the "SimpleDateSearch.fmp" from Steve Martino very helpful. This Log Reports layout does just about what I wanted BUT, This works but mine will not. My problems are that after setting the lookup for Dates = Custom that I cannot change either the start or end dates manually. The cursor will let me change these fields.
I am changing my scripts to similar to the working scripts but it still doesn't work. Trying to find the differences now.
Below are screen captures from Quickbooks (works the way I want) and my layout that does not work. Their are scripts not included to save space.
I found the problem, Just as OCDilla had mentioned. Oversite on my part has cost weeks of time and frustration. I did not make the start and end dates editable. Now at least I can set custom dates and keep moving.
Thanks everyone for the OBVIOUS solutions.
I forgot to ask in Steve's example, each field starts with "/* and ends with */? What is this and what does it do? I cannot find this online or my my books.
In C programming it means to comment out from /*........... to */ but what is it for and where does it come from in the example layout.
It means the field has been commented out when you imported the script or calculation. This is probably because you don't have the exact same table and field names. Remove the /* and the */ and FileMaker will let you know the problem.