I have a form on which the user selects, via a list box, the name of a particular company to populate the Company field of the underlying EVAL table. The list of company names is retrieved from the SUBINFO table. In the Actions field on the same form, I would like to use that chosen company name as the parameter for a query that retrieves specific records from the SUBINFO table pertaining only to that company and displays the query results in a list box in the Actions field. The selection from the Actions field list box would then populate the Actions field in the EVAL table. From what I can tell, in a given form, I cannot use a value in a particular field in that form as a parameter for a query to populate another field in the same form. I hope this isn’t too confusing, but this is driving me nuts. Simply put, I’d like the user to select, from a list, a particular company from Table A, and have actions associated with that company (also from Table A) displayed in the list box of another field on the same form. Both of these selections would populate fields in Table B. Please help.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Query Question
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Query Question
- This topic has 4 replies, 3 voices, and was last updated 24 years, 3 months ago.
AuthorTopicWSrhconley
AskWoody LoungerMarch 6, 2001 at 6:07 pm #353582Viewing 0 reply threadsAuthorReplies-
WScharlotte
AskWoody LoungerMarch 7, 2001 at 6:49 am #517659I’m getting confused by your explanation. You have a form based on the Eval table (by the way, change the table name. Eval is a built-in function, so the name is a reserved word and will cause you grief.) and you’re using a combobox to populate the Company field. The combobox gets its rows from the SUBINFO table, right?
Then you also have a control on the form bound to the Actions field in the Eval table. You’re using a listbox for that control and you want to populate the listbox with a query that uses the company name in the combobox as its criteria. You can do this, so you’ll need to be more specific about the problems you’re running into. You can’t based fields in a table on other fields, but there is nothing to stop you from basing the contents of one control on a form on the contents of another control on the same form.
However, if you’re trying to use the listbox to enter or display multiple values in the Actions field, don’t do it. It’s bad design and more suited to a spreadsheet or a product like FileMaker. Plus, although you can use a multiselect listbox to enter data, it won’t display it as you might expect.
-
WSrhconley
AskWoody LoungerMarch 8, 2001 at 1:43 pm #517910Charlotte, thanks for your help and patience. Let me try to simplify:
On FORM X, the user selects a company from a combo box (the companies are stored in TABLE A). Based on the company they select, I want only the actions associated with that company (also stored in TABLE A) to display in another combo box on the same FORM X. Both the company and action selections will be stored in TABLE B which is associated with FORM X. I just can’t make this happen! I hope this simplifies my conumdrum somewhat.
-
WSJim Bulger
AskWoody LoungerMarch 8, 2001 at 1:58 pm #517914Where is the master table of companies? Usually, in a normalized db, this situation would have two tables with a 1:M relationship (i.e. TABLE A (companies) contains one company record per company; TABLE B (actions) would contain all action records for the companies in TABLE A). Selecting a company from listboxA would then populate listboxB with all records from TABLE B for that company. Why do you need to store this information in another table for a forms recordsource?
-
WScharlotte
AskWoody LoungerMarch 8, 2001 at 2:25 pm #517920OK, what you’re describing is called various things, but what you’re trying to do is synchronize the two comboboxes. You want the contents of combobox2 to be based on the choice in combobox1, right? Then there are two ways to do this.
1. Base combobox2 on a saved query. In the criteria of the query under CompanyID (or whatever the field name is), you would have something like [forms]![formX]![ComboBox1]. In the Afterupdate event of ComboBox1 on your form, put this line:
Me!CombBox2.Requery
2. In the AfterUpdate event of ComboBox1, build a SQL string that is the equivalent of the saved query and that will return only the records you need for combobox2 for this company. Set ComboBox2’s controlsource property to that SQL string. The code would look something like this:
Private Sub ComboBox1_AfterUpdate() Dim strSQL as String strSQL = "SELECT [Actions] FROM TableA " _ & "WHERE TableA.Company=" & Me![ComboBox1] ComboBox2.ControlSource = strSQL ComboBox2.Requery End Sub
However, Jim’s question is a good one. And I’m uncomfortable with your earlier statement that the actions are stored with the company in TableA. Is TableA shaped something like: CompanyID, Action? Does it have one record for each possible action for each company where that action applies?
If not, or if it holds a bunch of actions in a single field, your design will never support what you’re trying to do.
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Have Copilot there but not taking over the screen in Word
by
CWBillow
6 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
1 day, 4 hours ago -
Are Macs immune?
by
Susan Bradley
18 minutes ago -
HP Envy and the Function keys
by
CWBillow
12 hours, 19 minutes ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
1 day, 15 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
1 day, 16 hours ago -
Unable to update to version 22h2
by
04om
6 hours, 40 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
1 day, 23 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
1 day, 23 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
1 day, 9 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
2 days, 12 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
2 days, 1 hour ago -
Is your battery draining?
by
Susan Bradley
12 hours, 38 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
4 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
2 days, 16 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
2 hours, 32 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
2 days ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
1 day, 17 hours ago -
National scam day
by
Susan Bradley
23 hours, 50 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
1 day, 20 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
3 days, 17 hours ago -
Tools to support internet discussions
by
Kathy Stevens
2 days, 6 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
3 days, 8 hours ago -
AI is good sometimes
by
Susan Bradley
4 days ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
3 days, 14 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
5 days, 1 hour ago -
June KB5060842 update broke DHCP server service
by
Alex5723
4 days, 23 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
5 days, 3 hours ago -
Excessive security alerts
by
WSSebastian42
3 days, 18 hours ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
5 days, 13 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.