move data between list boxes

L

Loni

I have a db with a Members table and a committee table
linked by MemberID. I would like to use a form like the
Forms Wizard to add members from the left list box to the
committee list box using buttons as the wizard does. Can
anyone tell me how to do this?
Thanks much,
Loni
 
G

Guest

Loni,

This is fairly simple if you understand working with arrays. A list box is
just like an array in respect to accessing columns and rows. Moving data
between the list boxes will depend on how you want to do things. If you want
to move the data arround back and forth between boxes before comitting
changes to the database then the best way to do this is to populate each list
box using arrays. Once changes have been accepted, the array data can then
be written to the database. For an understanding of how to do this you might
look in Access Help under listboxes. You should find the info you need under
headings: Listboxes->Source Data->Create a list box that gets its data from a
function.

Best of luck!
 
L

Loni

I am not sure if I understand working with arrays or
not. I am not worried about about moving back and forth
before comitting, my idea is when a name is selected and
the button pressed to add it to the committee list it
would be added at that time and the name would no longer
be visible in the members list but be visible in the
committee list. Names could be removed in the same way.
I searched the Access help files and couldn't find any
info like you suggested. I am using Access 2000 and it
seems I have seen something somewhere that the help files
in it are not very good. I also searched The Access Web
but didn't find anything I thought applied. Could you
point me in the right direction to find some information
about this?
Thanks,
Loni
-----Original Message-----
 
L

Loni

After my last post I did find the info on creating a
function for the source data. I am trying to understand
how to apply this to my situation.
Thanks,
Loni
 
P

PC Datasheet

Add a field named Selected (Yes/No) to the Members table. Use a query for
the rowsource of both listboxes. Selected needs to be in both queries. The
criteria for Selected in the left listbox is False and in the right list box
is True. In the left listbox, use the AfterUpdate event to set Selected to
True and requery both listboxes. In the right listbox, use the AfterUpdate
event to set Selected to False and requery both listboxes.
 

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

Similar Threads


Top