473,657 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2623
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!NameOfListbo x.Rowsource = Me!NameOfCombob ox
Me!NameOfListbo x.Requery

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"Seth Delaney" <sa******@excit e.com> wrote in message
news:27******** *************** **@posting.goog le.com...
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
2492
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 column. I want to allow the user to select the column to be searched. For eaxample, assume a list box that looks like this: ____________________________
2
1703
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 the report ask me (based on a query or something) what func_area I would like the report to be based on? ps. the report is based on a query so ultimately the selection has to be passed to the query.
5
1998
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 from the Event table. The way things are currently designed places a list of clients on the left side of the form (with a list box), and then there's a subform on the right side of the main form with fields to enter event information.
15
2618
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 = PROBLEM_DE.PROBLEMNR WHERE (((STATUSHISTORIE.STATUSDATUM)<#1/1/2005#) AND ((PROBLEM_DE.DATENBEREICH)='SPMO') AND (((Left((.),InStr(.,"-")-2)))='K29')
3
4026
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 table of customers, first column is the key field, which is hidden with a 0" width, and the second column is the customer name. The SQL is a union query that also inserts Null in the first column, and "All" in the second column. That combobox gets...
2
1315
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 I can automatically retrieve the specific query for the option the user chose. Is this possible? Thanks.
6
12900
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 value which is included in the listbox's filtering statement. Is the only way to do this is to dispose the dataview and then create a new one and then bind it to the listbox? Is there a better way than this? Thanks, Alpha
1
2752
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 select the combobox or even exit the form. It's as if something won't let me take focus away from the listbox -- all I'm able to do is navigate within the listbox.. There is no error or exception thrown -- I just can't access anything outside of...
6
1526
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 would like to make a form that when they selected their Name from a combo box, another combobox would take its selections from a query tied to their name and put their 6 Activities into the second combo box. Writing the query is no problem, I just...
0
8413
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.