Can an update query do this?

G

Gary

Hello, and thank you sincerely in advance for any
assistance on this issue.

Using Access 2000, I have three tables and one form used
in tracking employee training. One table [eetbl]is
tracking detailed employee information, another [clstbl]
is tracking detailed course information, and the third
[attendtbl] is tracking clsid and eeid (ie, who attended
which course).

The form has a bound multiselect listbox to [eetbl] and a
currently unbound listbox that the selected ee's dump
into. [clsid] is referenced on the top of the form.

What I need to do is create records in the [attendtbl] for
each selected employee [seleeid] and the course id from
the top [clsid] (the [clsid] would be the same for each
ee).

I think I can do this with an update query, but I'm not
sure. If it can be done, any assistance on getting
started would be greatly appreciated.

Sorry for being verbose, and thank you sincerely again.
 
N

Nikos Yannacopoulos

Gary,

To create records in a table you would need an append query, not an update
one. Still, the way you describe your form, I don't think a query could do
it, for selected items can be read from a multiselect listbox through code
only... I suppose you must already be using some code to "dump" your
selections to the unbound listbox (do you really need it?).

What I would do is open attendtbl as a recordset, and for each eeid in the
ItemsSelected of the bound multiselect listbox, add a new record to the
recordset with the eeid from the listbox and the clsid from the pertinent
control on the form. No use for the unbound listbox in the code, unless you
just want it so you can control your selections while scrolling through a
long list in the main one.

HTH,
Nikos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top