Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

how do I Match fields with first char?


This topic is 7178 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have layout which contains a listview of names

I put some buttons at the top like a phone book and added a find [A] for the A button, find for B button and so on.

I noticed that when I click the 'A' button, it finds not only names that begin with A, but names that have an A anywhere in the field. I really want to only find the names that Begin with A. in Perl it's ^A

I looked through the online help of filemaker, but did not see any mention of how to specify 'begins' with A

Regarding the approach above, is there an easier way to do this button / phone book lookup letter approach? For example, could I somehow get the text of the button, then pass that to a script, which will allow me to specify the letter in a find?

thanks for your help in advance,

sincerely,

J__

Posted

What do you mean by double post?

If i did double post this, then it was not intentional. I don't think i asked this qauestion anywhere else did I?

thanks,

J__

Posted

To find entries that begin with A, use

==A*

as the criterion.

This will find only items where A is the first character in the text. FileMaker searching is pretty weird when compared to regular expressions, but it's powerful once you learn the syntax.

Posted

Uh Barbecue or anyone, the second part to my question was is there an easier way to do this then having to click , what 5 times, for each button to set the find option?

thanks,

J__

Posted

Are you asking if you need to have a separate script for each find? The answer to that would be no. You only need one script like

Allow User Abort [Off]

Set Error Capture [On]

Enter Find Mode [ ]

Set Field [yourfield; "==" & Get(ScriptParameter) & "*"]

Perform Find [ ]

If [not Get(FoundCount)]

Show Custom Dialog ["There are no records starting with " & Get(ScriptParameter) & "."]

Show All Records

End If

Each button should call the script and pass the appropriate letter to it.

  • 3 months later...
Posted

Queue

I have tried to run this script and can manage to get it to say "There are no records starting with A" but that's it.

How do I "call the script and pass the appropriate letter to it"? I tried typing in an "A" in the optional script parameter section but it doesn't do anything.

Thanks

This topic is 7178 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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