I have a simple membership database which contains information on
individuals registered in 50 or so regional basketball associations. This
database is related to another with just the association-code and
association-description.
When entering a new player, I type in the relevant association-code and the
association-description is fetched. Then I input the player details. All
fine to here.
What I want to do is set up a serial-number which increments by 1 for each
association. If I had say 3 players entered for the Winfield association
their serials should be WIN0001, WIN0002 and WIN0003. If I entered a new
player for the Mt Beauty association, and it was the first entry in the
database for Mt Beauty, it should be serial MTB0001.
I have been figuring that I should be using some sort of count function. I
also thought I could do something with FMP ScriptMaker to find all records
matching the association-code on the current record I am entering up, and
the number of records found is equal to the numeric part of my required
serial field.
I hope I am making sense.
Thanks for any help
Roly
Try creating a self-join (a relationship from a file to itself) relationship
('Self_Associations'), based on the Association field in the Players file.
It sounds like you already have a similar relationship ('Associations") from
the Player file to the Association file. After selecting the Association for
a new player, your script can:
Set Field["serial-text", "Associations::Text_Code &
Max(Self_Associations::serial-number)+1")
...where 'serial-text' is the full serial ;number; (the value you want to
create) in a text field, "Text_Code" is the text prefix ('Win') specific to
each Association, and 'serial-number' is a number field that is incremented
for each player in a given Association.
--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance
"Giant" <ro...@kpcreative.com.au> wrote in message
news:3hp4a.50424$jM5.1...@newsfeeds.bigpond.com...
Yes, you're making sense, but you're also expanding beyond the "simple"
designation here. John Weinshel has given you one answer, though I
consider the MAX function to be a bit questionable as to performance
once record numbers in a file begin to grow. It gets a bit sloooow. :)
For variable serials based on criteria such as Association membership,
you should consider setting up a separate Associations file. Do not
under any circumstances name this file Ass.fp5. ;)
One record for each Association should have the association name, the
code used for it (such as WIN or MTB) and a field to hold the Serial
value. Then a relationship is created from the membership DB to the
association db, perhaps using the Association name. When a new
membership record is created, and the association chosen, you can
trigger a script which isolates the single association record, grabs the
serial value and inserts it into the correct field in the membership db,
and increments the field in the association record.
If this is intended to be a multi-user db, you'll have to do some more
work with record locking to prevent duplicate values, but for single
user it's that simple. Then you can produce a nice list of all your
associations with their codes and current serials and it's all easy to
see and administer.
--
Lynn Allen Allen & Allen Semiotics
FSA Associate Filemaker Consulting & Training
ly...@semiotics.com http://www.semiotics.com
I will try out both solutions and reply to the group. I should have done so
by now but am waiting to do it using FMPro Developer 6 which is coming today
I hope. I really appreciate your expert advice.
Roly Kukainis
Card Base - Better ID Solutions
From the heart of the Australian High Country
ro...@cardbase.com.au
"Lynn allen" <ly...@NOT-semiotics.com> wrote in message
news:1fqkniu.i0lyys1w5pbmkN@[192.168.1.101]...