![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi there again, Thanks for your help on my previous topic. I have another question. I will have multiple records for the same person, called the visit table, where I keep track of their visit information. I would like to have on these forms Visit ## of Total Visits for this person. So I want to be able to calculate the total number of records that person has in the database and assign the visit number as they come in based on the previous total. I am using filemaker pro 7 and there is no status or anything in there. I am trying to do this via a calculation so that it is automatically in there, but I can't seem to make it work in fm7. I am using the id number for the person as the identifying search criteria..but it just won't work. Thanks for any help chris |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
|
To make this work you will need; 1) a relationship from PERSON::ID Person to VISIT::ID Person 2) the calc field "TotalNumberOfVisits_c" in PERSON with formula: Count(VISIT::ID Person) 3) the auto-enter number field "ThisVisitNumber" in VISIT with auto-enter formula: PERSON::TotalNumberOfVisits_c + 1 4) (optional) the calculated field "TotalVisits" in VISIT with formula: PERSON::TotalNumberOfVisits_c Now each record in your VISITS table will contain both the current visit number and the total visit numbers. The field "ThisVisitNumber" in VISITS will only be populated by the auto-enter for new records, not existing ones. To populate the existing records, you'll have to write a script along the following lines: sort the records by ID Person and visit date set global number1 to blank starting at the first record loop through all records if ID Person <> global number1 then set global num2 to 1 set ThisVisitNumber to global num2 goto next rec end loop |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |