troubleshooting Question

Updating records selected in a multi select simple List box

Avatar of Nev Williams
Nev Williams 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...!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 29 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 29 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros