Jump 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 fields BEGINNING with particular letter ONLY

Featured Replies

  • Newbies

This seems silly that I have to post for this answer, but I'm going crazy. I have a database of company records, and I want to find companies that BEGIN with letter "A". Like "Acme Brick","American Financial",etc. NOT "Jim's Heating & Air" nor "Bob's Alley".

How can you do this in find mode and/or in a script? Below is an section of my script that doesn't seem to do the trick. HELP!

Enter Find Mode

Set Field [ Company, "A*" ]

Perform Find

Go to Record/Request/Page[ First ]

Loop

If [ not Left(LeftWords(Company, 1),1) = "A" ]

Omit Record

End If

Exit Loop If [ Status(CurrentRecordNumber) = Status(CurrentFoundCount) ]

Go to Record/Request/Page[ Next ]

End Loop

Use the following: ==a*

This will find records which are EXACTLY (by the ==) the letter "a" followed by zero or more characters (by the *).

The only way you have to find records beginning with a particular letter,without scripting and without forcing user to pick symbols from search palette, involves these steps:

  • create a calculated field (stored) in which you store the capitalized initial letter of the field in which you need perform the search (suppose LastName field).

    Automatically FM will calculate this for each rec. in your DB.

    Have this calculated field on your current layout or, better, in a search dedicated layout.

  • Enter find mode and fill this field with the letter (capitalized) you want to search for, then perform the search.

    On a fly you will have displayed all records (if any) beginning with the searched letter.

This trick is a good start point for building complex partial searches.

Have nice job & regards.

[ September 11, 2001: Message edited by: JPaul ]

showtopic.php.zip

quote:

Originally posted by JPaul:

The only way you have to find records beginning with a particular letter,without scripting and without forcing user to pick symbols from search palette, involves these steps:

This is correct and is a good way to do this kind of functionality.

Although most often you should use scripts for your finds anyway, and I am not sure that creating and searching on calculated fields is a better solution.

  • 5 years later...

Let's take this to the next level.

What if I create a layout with only buttons, one for each letter. I want the use just to clikc the letter by which they want to search.

I thought about using the script parameter and set the letter as a script parameter for each button. But have not found a way on how to use it within a script for the search.

A find won't allow me to specify the function get(scriptparameter) or a storage calculated field (global).

Any ideas?

If you have a button for each letter that passes a script parameter of the letter than:

Enter Find Mode []

Set Field [ Company, "==" & Get ( ScriptParameter ) & "*" ]

Perform Find []

Create an account or sign in to comment

Important Information

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

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.