please try setting your $DateRange variable before entering find mode. Also, you don't need to "clean up" local variables, which I think you're attempting with the last line (it should just have one $). FM disposes of $locals automatically.
Are the global date fields and the Table::Date field all set up as field type Date?
Maybe you need a commit records step at the start of the script
Ahhhh missed the obvious that David mentioned, about setting the variables before entering find mode.....
Both have you have hit on a point that crossed my mind while I was posting. Granted, I was scripting this based on pieces I'd dug up online, so I simply trusted what I found. I'll give the re-order a try and get back to you. THANKS
Yes, all three set to "Date" type fields.
Unfortunately, I changed the order to set variable before entering Find mode. No change.
I wonder if I should eliminate the Error capture simply to eliminate any possible problems that I may have created with it?
EDIT: No change. Still jumps to the "First Name" field after hitting OK.
I'm using 14 and it didn't matter if I set the variable inside the find or outside.
Try adding a Show Custom Dialog [$DateRange] so you can see what it holds. And please double-check that the global fields have global storage (they can be text or date).
Also, move your Pause step below the Set Field step.
Unfortunately, once again we see confusion about the Set Field command.
Your screen shot of the script is very helpful.
You are setting the repetition; not the value.
There are three parts of a set field command:
Optionally: which repetition?
Your script should look more like the first set field line.
good catch Bruce.
Thanks. This is such a CONSTANT source of confusion with new FileMaker users.
I would not be surprised to find it is the single most common source of error.
All due to a bad interface.
There are three things to set.
So let's show the user two of them at a time!
And when we show them ONE of the options (rep number) let's present it two different ways.
Let's NEVER reveal in a clear way, in one place, what the three choices are!
I tried to emulate what you've posted even before I came to the forum with the question. Unfortunately, I can't seem to enter it the way you've shown. When I specify the field to place the variable, it automatically places the brackets around the field name. How do I avoid that?