Retreive Query Values in a Listbox

Ragnar78

Board Regular
Joined
Feb 10, 2004
Messages
210
Hy,

I have a combobox that allows me to select the name of a Product...

This product is purchased from diffrent vendors.
My query retreives all the vendors, ordered by vendors status...

I tried RunSQL to retreive the info, it works but it put all the data in a table (INTO)

I was wandering if it was possible to retreive the data (Vendors or selected product) in a LISTBOX

Thx again for the help
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Ok,
i found a solution for it

launch the query with DoCMD.RunSQL with the "SELECT..INTO nTable..."

Code:
Set MyRS = MyDB.OpenRecordset(nTable, dbOpenDynaset) 

With MyRS

While not .EOF
Listbox.Add = nTable!Field()
wend

Docmd.delete nTable

The code is not perfectly writen her, but it sould give an idea

(y)
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,351
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top