Jump to content

Go to Record...


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

Recommended Posts

Hello,

I have a client list that is displayed in list form. I have a couple of different sorts that allow me to change the display order. I'd like to be able to "jump" to a specified letter of the alphabet, rather than having to scroll throught the entire list.

I've have created buttons that perform a find for a specifed letter, but I don't like that it destroys the sort order and omits the other records. I'd prefer to just "jump" down the currently displayed list as sorted.

Any ideas...??

Thanks,

Randy

Link to comment
Share on other sites

Create these fields:

cFirst - calculation(text) =Left(LastName,1)

gPickLetter - global(text)

cAlphabet - calculation(text)(unstored) ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Create a relationship called "FirstLetter" between gPickLetter and cFirst

Create the following scripts:

Jump

code:


Go to Related Record[FirstLetter]

Scroll Window [pagedown]

Scroll Window [To selection]


Next

code:


Set Field [gPickLetter, Middle(cAlphabet,Min(26,Position(cAlphabet, gPickLetter,1,1)+1),1)]

Perform Script [Jump]


Previous

code:


Set Field [gPickLetter, Middle(cAlphabet,Max(1,Position(cAlphabet, gPickLetter,1,1)-1),1)]

Perform Script [Jump]


Assign the Previous and Next scripts to buttons with the same name. These will then skip ahead and back to the records where LastName begins with the relevant letter.

This will give you a starting point. Since you are sorting in different ways, I assume that the list will not necessarily be in alphabetical order by Last Name. So, the way the scripts behave may require some tweaking.

Link to comment
Share on other sites

I've never done this, but you could try this:

Make a field in each record with the letter in it -- "Letter".

Make a global field with the search letter -- "LetterG"

Create a script that does something like this:

code:


Go to Record/Request [first]

Loop

Exit Loop If [ Exact ( Lower(Letter), Lower(LetterG) ) ]

Go to Record/Request [next, exit after last]

End Loop


This script starts at the first record and scrolls thrpough them until it finds a record where the letter matches the desired letter in LetterG. If no records match it finishes up on the last record.

Of course a portal and a type-ahead system might look a bit better...

Link to comment
Share on other sites

You can get carried away with this, but here is one method.

We can create a calculated and stored text field called a multikey. It would be something like this, where "PP" is the paragraph character from the calc box:

Left(LastName,1) &"PP"&

Left(LastName,2) &"PP"&

Left(LastName,3) &"PP"&

Left(LastName,4)

for the first 4 letters of the last name. If the last name were Smith, the resulting key would look like this:

S

Sm

Smi

Smit

Now, define a global text field. Establish a relationship to the same file (a self join) with the global key on the left and the multikey on the right.Then have all records display in a portal.

When you type "S" into that global field, all the records with a last name starting with "S" will appear, When you type "Sm" all the ones starting with "Sm" will appear.

This can be slow if ther are a lot of records, but it is another way to do this.

Old Advance Man

Link to comment
Share on other sites

This topic is 7256 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
 Share

×
×
  • Create New...

Important Information

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