October 8, 200817 yr I think I have finally poked enough keys I found my answer after I posted below. Will this do what I need?..it seems to work If[Get(RecordNumber)=Get(TotalRecordCount) Show Custom Dialog etc. ect. Hi, On my layout I have an arrow to move to the "Next" recod. How would I script the button so that when the user has advanced to the last record a message would show "You have reached the lat record" I know how to do the message part...I just cant seem to figure out how to script the button to know when it has reached the last record in the db. Thanks, Jim Edited October 8, 200817 yr by Guest
October 8, 200817 yr That will work, but you may want to use this instead: Get(RecordNumber) = Get(FoundCount) As a card-carrying BAD* advocate, may I also suggest you consider other options, such as calculated containers that show a "dim" arrow when you're on the last record of the found set. *Banish Annoying Dialogs
October 8, 200817 yr Author Thanks, I like the sound of the container option. But have no clue as how to accomplish that. Any direction would be appreciated. Jim
October 8, 200817 yr The idea is that you have a group of container fields that store your button graphics. I suggest a separate table, let's call it "Interface." The fields should be globals so that you can access them from anywhere without needing a relationship. For each button you need a field for the "lit" or active state and a field for the "dim" or inactive state. (Some people use field repetitions but now that we can have as many tables as we like, and dedicate one just for interface fields, I don't see the advantage.) In each table that you want to have navigation buttons, define these calculations: Be sure to return a result of container, and be sure they are unstored! /* First record */ Case( Get(RecordNumber) = 1; Interface::ArrowFirstDim; Interface::ArrowFirstLit ) /* Previous record */ Case( Get(RecordNumber) = 1; Interface::ArrowPrevDim; Interface::ArrowPrevLit ) /* Next record */ Case( Get(RecordNumber) = Get(FoundCount) ; Interface::ArrowNextDim; Interface::ArrowNextLit ) /* Last record */ Case( Get(RecordNumber) = Get(FoundCount) ; Interface::ArrowLastDim; Interface::ArrowLastLit ) You may not be using first/last buttons as well as previous/next but I've included them for completeness. I'm sure there are example files floating around...
Create an account or sign in to comment