spidrw@gnt.net (Andrew) wrote in message news:<d8c667d9.0411020921.3c5da36c@posting.google. com>...[color=blue]
> I've got two tables in my DB, a Client table and an Event table.
> There are many events for each client. The form I designed is based
> off of the Client table and the subform within it is sourced from the
> Event table.
>
> The way things are currently designed places a list of clients on the
> left side of the form (with a list box), and then there's a subform on
> the right side of the main form with fields to enter event
> information.
>
> What I'd like to have happen is to simply select a client name from
> the left side, enter the event information on the right and click
> submit, and then move on selecting other clients, etc. Right now I
> have a list box
> providing the client list. Is this right? I know there's an option
> when using the listbox wizard that involves using a record selected in
> the list box for other functions, but I can't figure out how that
> works exactly.
>
> Thanks,
> Andrew[/color]
Andrew,
are you sure you want just two tables? Can two people attend the same
event? If so, you need [Person]--[Attends]--[Event]. So Attends
would be something like (PersonID, EventID) with *both* as primary
key. Then if you wanted to have all the events a person is attending
in a listbox and move them back and forth, say between lbxAttending
and lbxNotAttending, you could use the .AddItem, and .RemoveItem
methods of the listbox (assumes 2002 or later). Then if you wanted to
use the selected items in a query, there's code right here...
(it's on
www.mvps.org/access somewhere...
right here:
http://www.mvps.org/access/forms/frm0007.htm
basic format of your form
lbxUnselected (one button for add, one for remove) lbxSelected
then use the code from the link to work with your query.
HTH,
Pieter