I don't think you want to use a form. I would write a command file that
would run with a trigger on the incident table. That way when a new row is
added to that table it runs the command and inserts or updates into the
service table automatically.

You can have it do the division of credit for the incident by doing a count
statement with a variable.

set var vcount = (count(staff_id)) in incidenttable where case_id = caseid

You can declare a cursor to get each one of the staff id in a loop



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David Ebert
Sent: Monday, July 16, 2001 3:35 PM
To: RBase Mailing List
Subject: Insert multiple records using a list of values


I have a service reporting table that usually collects values re:
face-to-face services between clinicians and clients.  The values stored are
the client id, staff id, date, service and units.

We have one department that performs general outreach services to a
non-client population.  I've created a 'dummy' case id for these.  The unit
value = the total units for the incident divided by the number of
participating staff members (maximum of six staff per incident).

I collect outreach incident information in another table (date, number of
staff, some demographic info on audience).

I'm trying to produce a service entry form that looks up service dates from
the general outreach table (ok so far), then the participating staff
members.  Using these two values and known constants (service code, client
id) I can insert rows in my service table for each staff member to allow us
to credit staff with productivity for the incident.

My question is how to use a form to collect date and staff values for the
run and insert one row for each staff member.  If we had six staff each time
it might be easier, but the number can vary.  It feels like I'd need a
lookup for the date and a loop to fetch the staff id numbers and insert
those and the constants into the service table.

At this point my eyes cross.

Can anyone offer a general description to achieve such a thing?

tia

Dave Ebert
[EMAIL PROTECTED]


Reply via email to