473,395 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Display Query in listbox from combobox

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
1 2604
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Top | last post by:
I want a listbox to position to a letter provided by the user. Normally, when the user keys a letter, the listbox positions automatically to the first entry starting with that letter in the first...
2
by: seansan | last post by:
Hi, suppose I have one report that reports some data to me based on a functional area that I define. We have about 20 func_areas and every time the report is the same. Is there some way to have...
5
by: Andrew | last post by:
I've got two tables in my DB, a Client table and an Event table. There are many events for each client. The form I designed is based off of the Client table and the subform within it is sourced...
15
by: Jean | last post by:
Hello, I have the following query that I set up as a test, and it runs fine: SELECT STATUSHISTORIE.* FROM STATUSHISTORIE LEFT JOIN PROBLEM_DE ON STATUSHISTORIE.PROBLEM_ID =...
3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
2
by: VMI | last post by:
Is it possible to display something in a combobox and store something else? For example, can I display "Query for active employees" and save the actual query in the same combobox item? That way...
6
by: Alpha | last post by:
I have a listbox with datasource from a dataview. When a user selects a different item in a combobox then I need to refresh the listbox to the appropriate listing based on that combobox's selected...
1
by: Crazy Cat | last post by:
Hi, I have a form with a databound listbox and combobox. The listbox items are filtered based on the selection for the combobox. If I click on the listbox to select an item, I can no longer...
6
by: JonnyRotten | last post by:
I have two tables The first has a ID (key) field and enteries for Name The second has a ID field (tied to the first) and then 6 fields for activities. Called Activity1, Activity2, etc etc I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.