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
-
Windows 11 Insider Preview build 26200.5661 released to DEV
by
joep517
53 minutes ago -
Windows 11 Insider Preview build 26120.4452 (24H2) released to BETA
by
joep517
54 minutes ago -
Hello Windows…My Problem is Windows Hello…
by
rdleib
2 hours, 10 minutes ago -
New Canon Printer Wants Data Sent
by
Win7and10
2 hours, 28 minutes ago -
I set up passkeys for my Microsoft account
by
Lance Whitney
19 minutes ago -
AI is for everyone
by
Peter Deegan
2 hours, 1 minute ago -
Terabyte update 2025
by
Will Fastie
7 hours, 21 minutes ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
34 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
1 day, 1 hour ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
1 hour, 43 minutes ago -
Plugged in 24-7
by
CWBillow
11 hours, 12 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
1 day, 14 hours ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
1 day, 11 hours ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
3 days, 5 hours ago -
Are Macs immune?
by
Susan Bradley
1 day, 3 hours ago -
HP Envy and the Function keys
by
CWBillow
2 days, 13 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
6 hours, 32 minutes ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
3 days, 17 hours ago -
Unable to update to version 22h2
by
04om
1 day, 1 hour ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
4 days ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
4 days ago -
Very Quarrelsome Taskbar!
by
CWBillow
3 days, 10 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
4 days, 13 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
4 days, 2 hours ago -
Is your battery draining?
by
Susan Bradley
8 hours, 11 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
1 day, 1 hour ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
4 days, 17 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
19 hours, 41 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
4 days, 1 hour ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
3 days, 18 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.