troubleshooting Question

Updating records selected in a multi select simple List box

Avatar of Nev Garven
Nev GarvenFlag for New Zealand asked on
Microsoft Access
29 Comments1 Solution174 ViewsLast Modified:
Hi everyone,

My first question.  

On form, frmAddBuyer, is a field containing the buyerID (PK in tblBuyer), for the current buyer.

I have two listboxes on the form.  The first multi-select listbox shows the books currently in stock and available to be bought, based on tblSale.  The table name might be a bit misleading, but all books entered into the database are added to tblSale.

The 2nd listbox shows the the books that have been bought by the current buyer.

There is a combo box on the form, that filters the books, based on the bookID.

What I need to happen after I have selected multiple books in the first listbox, is click on my Add Purchase button, and have the selected books move across to the 2nd list box, and have both listboxes refresh.  The selected books in the first listbox will no longer be shown as available and in stock.

The rowsource for the first listbox is: SELECT [qryKawProductAvailable].[BookID], [qryKawProductAvailable].[SaleID], [qryKawProductAvailable].[BookName] FROM qryKawProductAvailable ORDER BY [SaleID];   The bound column is column 1.

The rowsource for the 2nd listbox is:  SELECT [qryKawProductAllocated].[buyerID], [qryKawProductAllocated].[BuyerTrademeName], [qryKawProductAllocated].[BookID], [qryKawProductAllocated].[BookName], [qryKawProductAllocated].[SaleID], [qryKawProductAllocated].[BookInStock], [qryKawProductAllocated].[AuthorType] FROM qryKawProductAllocated ORDER BY [buyerID];   The bound column is column 1.

I'm thinking when the button is clicked, it opens a recordset based on tblSale, and the books selected in the first listbox.  As it cycles through each record, it inserts the buyerid into the buyerid field, and changes the bookInStock field to No.

Sorry for any confusion...!
ASKER CERTIFIED SOLUTION
Tusitala

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 29 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 29 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004