copying list box selections into append query

Cowboy_BeBa

Registered User.
Local time
Today, 15:44
Joined
Nov 30, 2010
Messages
188
hi

ive got a listbox on one of my forms (with multi select enabled)
essentially its a list of products, the idea is for the user to select as many products as he or she likes, then they click a button and the selected products show up in an append query, which will add records to a table

just curious how to copy the data from a list box to an append query (noting that each selection should have its own row)

i also wanna look into "Select All" and "Select None" buttons, anyone know if this is possible?
 
lol, the world is indeed a small place mr pbaldy, i literally just stumbeld upon that site about 2 minutes ago (After much googling)

thank you so much, looking through the sample youve provided now, ill let ya know how i go :)

havent checked, but does it also include a select all/none feature, or should i keep looking for that?
 
It checks for nothing being selected. To do a select all, I'd probably just have a checkbox for it, and in the code if it's checked loop the entire listbox instead of the selected items.
 
thanks baldy, applied your sample to my DB and it works great (plus it helped me learn a little about coding, never knew you could do "Exit sub", very simple, but helps me simplify alot of my code)

the only issue im having now is all this is on a split form and atm i have to close and reopen the form to refresh the table

ive tried doing me.refresh and me.requery ath the end of the code, but it doesnt help
is there anything i can do to refresh it

also in regards to the select all, select none buttons, i do not want them to automatically trigger the code. essentially it is quite a large list, a user may wish to add all items except one or two, or they mayve selected quite a few items and want to clear them, so using the same code but looping through the whole list might not work
 

Users who are viewing this thread

Back
Top Bottom