auto enter value based on previous record

hi all,
i have a table of monthly statements, there is only one statement per month,
one record is one statement. when i create a new record i'd like a field in
it to auto enter the next month. this really boils down to one of two
questions:

1) how to get the value of a field in the "last" record. i put "last" in
quotes because "last" could be last in a found set or last created- getting
the last in a set is simple it's the last created i'm less sure of. (and
this brings up another question: if you create a record with an auto entered
value referencing the "last" record will it reference it self or is the
record not considered "created" till all the auto entered values are
calculated?)

2) from within a calculation that can be used to auto enter in to a
field, how to get the largest/smallest (or whatever comparison) value in a
field.

i'm using fmp9advanced, win. thanks
Conrad Lorda [ Do, 16 August 2007 06:13 ] [ ID #1796772 ]

Re: auto enter value based on previous record

i solved this with an X type self join and the MAX (field) function:

Max (x self join :: date field)

it seams an auto entered value in a created record wont reference it self

"Conrad Lorda" <conradlorda [at] gmail.com> wrote in message
news:KK-dnWqypb5gU17bnZ2dnUVZ_vOlnZ2d [at] comcast.com...
> hi all,
> i have a table of monthly statements, there is only one statement per
> month,
> one record is one statement. when i create a new record i'd like a field
> in
> it to auto enter the next month. this really boils down to one of two
> questions:
>
> 1) how to get the value of a field in the "last" record. i put "last" in
> quotes because "last" could be last in a found set or last created-
> getting
> the last in a set is simple it's the last created i'm less sure of. (and
> this brings up another question: if you create a record with an auto
> entered
> value referencing the "last" record will it reference it self or is the
> record not considered "created" till all the auto entered values are
> calculated?)
>
> 2) from within a calculation that can be used to auto enter in to a
> field, how to get the largest/smallest (or whatever comparison) value in a
> field.
>
> i'm using fmp9advanced, win. thanks
>
>
>
Conrad Lorda [ Fr, 17 August 2007 02:20 ] [ ID #1797793 ]

Re: auto enter value based on previous record

In article <z6-dnfJEjMdRdFnbnZ2dnUVZ_vyinZ2d [at] comcast.com>, "Conrad
Lorda" <conradlorda [at] gmail.com> wrote:

> i solved this with an X type self join and the MAX (field) function:
>
> Max (x self join :: date field)
>
> it seams an auto entered value in a created record wont reference it self

The auto-enter data is entered into the fields when the new record is
created, so that new value doesn't exist to the Relationship until the
record is saved.

You can see this most easily by having two files. Create a relationship
from one to the other. In the Parent file have a Portal displaying the
related records. move the window to one side and in the Child file
create a new record with the cursor wating in one of the fields - this
new record will not appear in the Portal until after you have exited it
(by clicking outside all the fields or pressing the keypad's Enter
key).

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Helpful Harry [ Fr, 17 August 2007 02:29 ] [ ID #1797794 ]
Datenbanken » comp.databases.filemaker » auto enter value based on previous record

Vorheriges Thema: Help Script Multiple Fields Mandatory Value For Find
Nächstes Thema: Easy Problem for you guru's....Missing Table After Using Layout Setup