Dave,
You can probably do this as one or two sql statements. If you post
some sample data and what you want to have happen, someone
on the list can probably help in writing the insert statement (I'm out
of town from now until tomorrow pm or I'd offer). For that matter,
your service reporting table could/should actually be a view, and
this consideration blended in.
A couple of voices on this list have endorsed the use of views
pretty strongly; and between the use of views and multi table
updates/inserts I _rarely_ use cursors any more.
Ben Petersen
On 16 Jul 2001, at 19:20, David Ebert wrote:
> I think I've partially answered my own question: this isn't a job for a
> form.
>
> Run a CHOOSE of outreach dates, CHOOSE chkbox the department's staff, SSUB
> the id's into a temp table, count those values not null, divide the units by
> that integer and insert the staff id's, divided units, and constants into
> the service table.
>
> ???
>
> Dave Ebert
> [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > Behalf Of David Ebert
> > Sent: Monday, July 16, 2001 6: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]
> >
>
>