Hi Gwyn
I have modified the process for a second entry on same child as you suggested. It first saves a variable with child's ID which then serves as the filter for the passengers form, after which it calls in a list process on the passengers form. Since it is updating an existing record I do not clear the form. The list process should simply updates the relevant fields in Passengers and then replaces the entry.
FYI the first entry still uses the checkbox On Change commands to clear the passengers form and add the entries. It work fine but I want to replace it with a list process once I get it working.
So what happens is this:
1. I add a first entry for Child A (fetch from school). All fields are correct.
2. I update this entry with the 2nd trip (take to school.) Fields are updated correctly.
3. I add a new entry (for a child in a different school and different bus stop). There is a new record in Passengers but I found the following errors:
i) The record with the most correct fields (record 1) has the Parent ID for the 2nd child.
ii) The 2nd record has the ID of the 1st child;
iii) and has no Parent ID;
iv) and the checkbox for School is cleared;
v) and the school name is completely wrong but the bus stop is correct;
vi) and the school pickup time is that of the 1st child (wrong for the incorrect school in this record as well as for the child's actual school.)
The On Change commands do the following: (If checkbox = true) **checkboxes in Child form**
If counter = 0 : (new entry)
1. Change counter to 1, replace entry for Child
2. Clear Passengers.
3. Add the relevant data to fields in Passengers from Child record. Data not in child record is added via Search Form commands.
4. Run a List Process form Parent/Child table to get Parent ID. (This table is an Outer Join table to connect >1 parent to >1 child.)
5. Saves as new entry in Passengers.
If counter = 1: (update existing entry) ** for taking to school in his example **
1. Change counter to 2; replace entry for Child
2. set var to child ID
3. run list process: Passengers form, filtered on dates for upcoming weekend and child ID
The list process command are:
1. Update School checkbox to true
2. Add data for fields: Bus stop to school, Departure time at bus stop, school drop-off sequence number, amount due for trip, parent ID.
3. Replace entry.
So the list process changes the value of School to 1 but it is actually cleared (error 3.iv)
# the bus stop comes from a Search on Children and is correct
# there is a Search on school name in Passengers to get drop-off sequence number but it does not update school name (error 3.v). How is school name and pickup time changed by itself?
# the Parent ID search source is Children so maybe it should come from child ID in current Passengers entry? (error 3.i and iii)
# there is no command regarding child ID because it is already there. How does it change by itself?
I wonder if I do a new Search, the previous link is probably lost since it now points to a different record? So to get a value from the original search table I will have to do that Search again? That's what I currently do.
Thanks so far.