Assign predefined query

  • Thread starter Thread starter Hajo
  • Start date Start date
H

Hajo

Hi,

under Queries, I defined a working query, named qryTest. Now I want to
assign this query to a ListBox.
I do it like this:
lstBoxTest.rowsource=qryTest

But that doesn't work. I guess I have to identify qryTest better?!

Thank you,
Hajo
 
Why do you not go to the properties sheet for the listbox, and select the
query when you click Row Source?

It might be that, in code, you have to identify "lstBoxTest" better... if
you are in code for the Form in which lstBoxTest resides,
Me.lstBoxTest.RowSource = qryTest, or, if not,
Forms!nameoftheform!lstBoxTest = qryTest.

Larry Linson
Microsoft Office Access MVP
 
Thank you very much Larry. I forgot to put the query name in exclamation
marks. Hajo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top