Copy listbox selection to second listbox (1 Viewer)

P

pfection

Guest
I wish to use two listboxes in selecting names for a mail list.

The first contains all available names. Filled from a standard Access 97 table.
The second is empty.

Double clicking on the required name in the second listbox instantly copies the selection to the second listbox. Double clicking any selection contained within the second listbox removes that selection.

I cannot for the life of me copy the name from one listbox to the other.

Any suggestions will be gratefully accepted.
Regards
Craig
 

Clarence

Registered User.
Local time
Today, 08:38
Joined
Oct 3, 1999
Messages
14
There are 2 standard methods, one easy the other more complicted. The easiest method is to add an additional True/False (yes/NO) field to the table containing your listbox source data.
When you select an item in Listbox 1 then set this field, in code, to TRUE

The listbox 1 should have a query which selects records whwere the status of your new field is TRUE and Listbox 2 should have a query which selects records where your new field is set to FALSE

Each time you select a record in eithe Listbox 1 or 2 then requery both listbox 1 and 2.
This method is O.K for single user environments but you will have additional work to do if your program runs in a multi user environment.

The alternative is to look at the example in the "ACCESS DEVELOPERS HANDBOOK" from SYBEX where a more comphrehensive system is shown

If you do not have this book then I can personnaly recommend it as a must have
Hope this helps
 

Users who are viewing this thread

Top Bottom