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

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

Recommended Posts

  • Newbies
Posted

Hi Folks, I am a newbie to the Forum and FMP. Find it more user friendly than Access :o . I have a very simple request for help (well I thnik so) I have managed to import to my database from excel all the membership info of my Club. I have designed a resonable layout, and have managed to place a couple of buttons, now this is where I am stumped. I wish to assign a script to one of the buttons for a [color:red]Surname search. ie click on button blank window pops up type in surname looking for, enter and it goes to first one found, also click other button to scroll through all other names matching the search criteria.

How do I do this please ?

Posted

Hi clubracing, welcome to FM Forums! :smile2:

You need to perform a Find. It provides a sub-set of records which match the find criteria and you will end up on the first record. To go to the next record, if a form layout, place 4 arrow buttons and right-click and Button Setup and select step: Go To Record/Request/Page [ First ] to the first button, etc. If it's a List layout, use your up/down scroll bars or put buttons in the header. Now to the Find script ...

The nice thing about another window is that a User can display two completely different found sets side by side (or even preserve a prior found set in another layout). And if the Find fails, it doesn't disturb the original set either. Attach the following script to your FIND button (on your form layout):o

[color:blue]

Set Variable [ $WindowName ; Get ( WindowName ) ]

Freeze Window

Allow User Abort [ Off ]

New Window [ ]

Commit Records/Requests

## If you wish to provide Users with a list which contains all the fields they may want to search, insert a [color:blue]Go To Layout [ that list layout ] here ...

[color:blue]Set Error Capture [ On ]

Enter Find Mode [ pause ] (this lets the User type into the field what they want to find)

[color:blue]Perform Find [ ]

## If no records are found then the window will simply close.

[color:blue]If [ not Get ( FoundCount ) ]

Show Custom Dialog [ "No records found." ]

Close Window

Else

## If you switched them to a list layout (above) then you will have to decide whether to leave them on this list and possibly close the original window; or switch them back to the original layout (taking this found set with you). This will return you to the original layout with your found set:

[color:blue]Close Window [ $WindowName ; Current File ]

Go To Layout [ Original Layout ]

Set Window Title [ Current Window ; New Title: "$WindowName" ]

End If

I'm trying to be explicit here because the worst thing you can do is leave errant windows open throughout your solution. If you don't track them (or close them behind you) then they will stack up on you and crash your User (particularly on Windows). Using multiple windows to display User found-sets is quite powerful but always perform proper cleanup afterwards.

I can't envision exactly how you want the found set displayed but this should get you going. :wink2:

LaRetta

  • Newbies
Posted

Wow . . LaRetta

Thank you for the quick and detailed response, something I didn't expect over the Christmas period. I will be using all the samples you have offered me to see if (as I suspect) this is the answer to the questions I seek. The Forum has proved very useful, certainly to a new user like myself. Off I go to give it a try :smile2: Thank you once again

This topic is 6543 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.