Query results back to a listbox

dan-dre

New member
Local time
Today, 09:18
Joined
Dec 8, 2003
Messages
7
Hi All,

Here's the situation: I click a button on a form and this fires a query nicely. The thing is, I want the query results to be added to a listbox. Does anyone know a suitable technique?

tia,


Dan
 
Set the RowSource of the list box to the query SQL source

Does the button that 'fires' the query change the code of the query? If so then if you have the SQL string assign it to the rowsource of the listbox. Else:

'CODE ON FORM
set qdfTemp = currentdb.querydef("QueryName")
me.lstBoxName.RowSource = qdfTemp.SQL

HTH
 
Smashing... works a treat thanks!

BTW - my main experience is in Oracle and DB2 so this Access stuff is really quite different to me! Can you recommend a decent book on the VBA side of things? All the Access books i've seen just seem to spend their time telling you how to use wizards etc - and I'm much more keen to program the thing for myself!!

Thanks again for your help
 

Users who are viewing this thread

Back
Top Bottom