September 22, 200421 yr I have a minimum field and a maximum field. All two are number fields. If I want to find records ranging from 1 to 10, it is easily to enter >=1 in the minimum field and <=10 in the maximum field. But I don't know how to make a script to do this find. Does anyone cn help me? Thanks in advance.
September 22, 200421 yr Enter Find Mode Set Minimum to ">=1" Set Maximim to "<=10" Perform Find Or just perform this find once and have the script remember the find. be certain to turn "Error Capture On" in case 0 records are returned.
September 23, 200421 yr Please update your profile to reflect the platform, operating system, and version of FileMaker you are using. The link is just below your name in the box on the left, it the word "profile" in blue. Lee
September 26, 200421 yr Author I wrote a find script for two number fields: Min Number and Max Number. I want to do a search to show records that have value ranging from the minmum to the maximum. Set Error Capture (On) Go to Layout ["Find"] Pause/Resume Script [] Enter Find Mode [] Set Field ["Min Number", "">=" & gMinNumber"] Set Field ["Max Number", ""<=" & gMaxNumber"] Perform Find [] When I enter numbers into the gMinNumber and gMaxNumber fields, it returns the results normally. But when one of the field is entered nothing, it shows all the records in the find results. Does anyone know how to I fix the problem?
September 26, 200421 yr Do you want to allow either field to be empty or force both to be entered? If the former, after your Pause/Resume step, I would add If [isEmpty(gMinNumber & gMaxNumber)] Show Custom Dialog ["You didn't enter any criteria."] Go to Layout [original] Halt Script and then Enter Find Mode [ ], followed by If [not IsEmpty(gMinNumber)] Set Field [Min Number, ">=" & gMinNumber] End If If [not IsEmpty(gMaxNumber)] Set Field [Max Number, "<=" & gMaxNumber] End If Perform Find [ ] By the way, if gMax and gMin can only be whole numbers, then you can also use Set Field [Min Number, ">" & gMinNumber - 1] and Set Field [Max Number, "<" & gMaxNumber + 1], if you prefer.
Create an account or sign in to comment