I have a program inherited from another developer and I am getting a strange 
behavior with a FIND script. It works the first time but if I cancel or switch 
to the Browse view and come back into the Preview mode, it no longer works. It 
also fails if I cancel the script and try to come back later to test again. I 
have to restore the table from backup to resume development.

I have an Entry screen that collects the Start Date, Ending Date and Driver 
Name then the Execute button performs the script which looks like:

Copy[Select, "Combine Date for Find"]
Go To Layout ["Drivers Sales Report Chronological"]
Enter Find Mode []
Paste [Select, "Invoice Date"]
IF ["Driver Name Global > "a""]
    Set Field["Delivery Type","Drive Name Global"]
End If
Perform Find[]
Sort[Restore, No Dialog]
Enter Preview Mode [Pause]
Set Error Capture[On]
Print Setup[Restore, No Dialog]
Print[]
Enter Browse Mode []
Go To Layout["Entry Screen Drivers Sales R....."]

The Combine Date for Find is a Global calculated field that prepares the test 
string on the Invoice Date field. Its format is 
Start Date %"..."% End date.

If I cancel out of this script at any time or open the screen that performs 
this script, everything goes out of whack. I get an error that there is no 
valid search criteria. Once this problem occurs I can never fix it.


Reply via email to