dbTalk Databases Forums  

go to a record

comp.databases.filemaker comp.databases.filemaker


Discuss go to a record in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stephen Larivee
 
Posts: n/a

Default go to a record - 01-02-2010 , 06:34 PM






I am using FMP 10 on Windows XP.

I have many records that all have a date field. I have the fields sorted by
date. As I move ahead or back record by record, I would like to place a
script/button on the layout that would take me back to today's date. I do
not want to do a find and enter //. That will take me to the current date
but I will not see the rest of the records. I see "GO TO RECORD" as a
script possibility but the only choice that seems to work is a Calculation
but you have to enter something that comes back as a Number.

What am I doing wrong? What can I enter as a script to continue to show all
records and in the order they are sorted but just go to the record with
today's date???

Thanks

Reply With Quote
  #2  
Old   
Lynn Allen
 
Posts: n/a

Default Re: go to a recordX-TraceApproved - 01-02-2010 , 09:55 PM






On 2010-01-02 16:34:44 -0800, "Stephen Larivee" <lariveesl (AT) yahoo (DOT) com> said:

Quote:
I am using FMP 10 on Windows XP.

I have many records that all have a date field. I have the fields
sorted by date. As I move ahead or back record by record, I would like
to place a script/button on the layout that would take me back to
today's date. I do not want to do a find and enter //. That will take
me to the current date but I will not see the rest of the records. I
see "GO TO RECORD" as a script possibility but the only choice that
seems to work is a Calculation but you have to enter something that
comes back as a Number.

What am I doing wrong? What can I enter as a script to continue to
show all records and in the order they are sorted but just go to the
record with today's date???
Since you have FM10, you can have a script that on entering that
screen, finds the record with today's date, and then stores the record
number in a global variable. Then you can use GoToRecord using that
variable in place of the record number calc.

If the current-date record isn't in the found set, or if you resort or
refind after the above script runs, though, it will fail.

More robust but far slower if there are large record counts is a
looping script. Pseudocode:

Go to Record [first]
Loop
Exit loop If (Datefield = Get(Currentdate))
Go to Record [next, exit after last]
End Loop

If your current date record is near the top in your sort order, this
could be very fast. If it's 5000 records down, not so fast. If the
record is not in the found set, it's still going to fail. You might
want to include a Show All Records and a Sort in there, if that won't
screw up your purposes in being on that screen.

Faster and something that will ignore found sets is setting the current
date into a global field, then making a relationship from the global to
your DateField. GoToRelated Record using that relationship will get you
there instantly. Dont' click "show only related records" and it won't
disturb your sort order.
--
Lynn Allen
--
www.semiotics.com
Member FBA
FM 10 Certified Developer

Reply With Quote
  #3  
Old   
Stephen Larivee
 
Posts: n/a

Default Re: go to a record - 01-04-2010 , 03:29 PM



Thank you. I will try this out.

"Lynn Allen" <lynn (AT) NOT-semiotics (DOT) com> wrote

Quote:
On 2010-01-02 16:34:44 -0800, "Stephen Larivee" <lariveesl (AT) yahoo (DOT) com
said:

I am using FMP 10 on Windows XP.

I have many records that all have a date field. I have the fields sorted
by date. As I move ahead or back record by record, I would like to place
a script/button on the layout that would take me back to today's date. I
do not want to do a find and enter //. That will take me to the current
date but I will not see the rest of the records. I see "GO TO RECORD" as
a script possibility but the only choice that seems to work is a
Calculation but you have to enter something that comes back as a Number.

What am I doing wrong? What can I enter as a script to continue to show
all records and in the order they are sorted but just go to the record
with today's date???

Since you have FM10, you can have a script that on entering that screen,
finds the record with today's date, and then stores the record number in a
global variable. Then you can use GoToRecord using that variable in place
of the record number calc.

If the current-date record isn't in the found set, or if you resort or
refind after the above script runs, though, it will fail.

More robust but far slower if there are large record counts is a looping
script. Pseudocode:

Go to Record [first]
Loop
Exit loop If (Datefield = Get(Currentdate))
Go to Record [next, exit after last]
End Loop

If your current date record is near the top in your sort order, this could
be very fast. If it's 5000 records down, not so fast. If the record is not
in the found set, it's still going to fail. You might want to include a
Show All Records and a Sort in there, if that won't screw up your purposes
in being on that screen.

Faster and something that will ignore found sets is setting the current
date into a global field, then making a relationship from the global to
your DateField. GoToRelated Record using that relationship will get you
there instantly. Dont' click "show only related records" and it won't
disturb your sort order.
--
Lynn Allen
--
www.semiotics.com
Member FBA
FM 10 Certified Developer

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.