Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Find range script

Featured Replies

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.

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.

  • Author

I am new to FM. Can you show me to how to write out the script?

What FM version are you, kfok?

  • Author

I am using FM 5.5.

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

cool.gif

  • 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?

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.

  • Author

Thank you for your help.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.