By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

Display Query in listbox from combobox

P: n/a
I have a form with a combobox and a list box. The combobox will list
records (names of queries) that are entered in a table called
tblListName. I have the combobox set to get its values from this
table. tblListName has two fields: ListName and QueryName where
QueryName is the actual name of the query and ListName is a "friendly
name" to be displayed. No problem, I'm good so far.

However, I have trouble here: I want the listbox to list records (same
fields for each query) from the query that was selected in the
combobox.

Any help is appreciated... I've done an exhaustive search on this
group and have yet to find the solution.

Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This will only work if the order of the fields in all the queries is such
that the bound column you want in the listbox is in the same field position
in all the queries and the field you want to display in the listbox is in
the same field position in all the queries. If not, you need to store this
information in your table of queries also.

Assuming the above conditions are met, all you need do is make sure the name
of the query is the bound column in your combobox and then in the
AfterUpdate event of the combobox, put this code:
Me!NameOfListbox.Rowsource = Me!NameOfCombobox
Me!NameOfListbox.Requery

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Seth Delaney" <sa******@excite.com> wrote in message
news:27*************************@posting.google.co m...
I have a form with a combobox and a list box. The combobox will list
records (names of queries) that are entered in a table called
tblListName. I have the combobox set to get its values from this
table. tblListName has two fields: ListName and QueryName where
QueryName is the actual name of the query and ListName is a "friendly
name" to be displayed. No problem, I'm good so far.

However, I have trouble here: I want the listbox to list records (same
fields for each query) from the query that was selected in the
combobox.

Any help is appreciated... I've done an exhaustive search on this
group and have yet to find the solution.

Thanks

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.