How do I limit the contents of one combo box based on the value selected in another
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Access Combo Box (2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Access Combo Box (2000)
- This topic has 9 replies, 5 voices, and was last updated 22 years, 10 months ago.
AuthorTopicWSemmacox100
AskWoody LoungerApril 24, 2002 at 3:02 pm #370051Viewing 1 reply threadAuthorReplies-
WSCecilia
AskWoody Lounger -
WSFrancois
AskWoody LoungerApril 24, 2002 at 3:53 pm #584322I think it would be better in the after update event of combo1
If your selection in a numeric value :Me!Combo2.RowSource = "Select Field1, Field2 from Table1 Where SelectionField = " & Me!Combo1 Me!Combo2.Requery
If your selection in a string
Me!Combo2.RowSource = "Select Field1, Field2 from Table1 Where SelectionField = '" & Me!Combo1 & "'" Me!Combo2.Requery
-
WSThomasW
AskWoody LoungerJune 5, 2002 at 10:51 pm #592549I have a main form for a literary Source and a subform in which a user can enter many Themes and Subthemes for that Source. The subform is a continous form type. Based on the Theme, only certain SubThemes populate the second combo box.
Your code works well; I modified it to:Private Sub ThemeID_LostFocus()
Me!SubThemeID.RowSource = “Select SubThemeID, ThemeID, SubTheme from tblSubTheme Where ThemeID = ” & Me!ThemeID
Me!SubThemeID.RequeryEnd Sub
But I have a problem that I am not sure how to address. This works well for the first record in the subform, but when a user tries to enter another subform record, the entry in SubThemeID for the previous records appear as blank. The proper value is saved to the table for every subform record, but the user sees a blank and that doesn’t inspire their confidence. I understand the Requery is doing this, but how can I get this to work and still display the previously entered values on the previous records?
TIA
-
WScharlotte
AskWoody LoungerJune 6, 2002 at 3:37 am #592583This is typical behavior with comboboxes on a continuous form because there is really only one combobox , the one on the current record. The rest are illusory. When you change the rowsource of the combobox, you’re seeing the current rowsource displayed in all the records, and that rowsource may not include the values that exist in the other records.
There are several ways to deal with this, but I prefer to use a textbox bound to the same field as the combobox. I put the textbox on top of the combobox (you can also shrink the combobox down until only the dropdown arrow is visible) and lock the value in the textbox. I set the tabstop property of the combobox to No so that the user has to actually click the arrow to drop the combobox down. That way, the textbox will still display the actual value even if the textbox rowsource doesn’t match that particular record’s value.
-
WSFrancois
AskWoody Lounger -
WScharlotte
AskWoody Lounger -
WSFrancois
AskWoody Lounger
-
-
-
WSThomasW
AskWoody Lounger -
WScharlotte
AskWoody Lounger
-
-
-
Viewing 1 reply thread -

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
-
My 3 monitors go black & then the Taskbar is moved to center monitor
by
saturn2233
8 hours, 34 minutes ago -
Apple backports fixes
by
Susan Bradley
8 hours, 43 minutes ago -
Win 11 24H2 will not install
by
Michael1950
8 hours, 48 minutes ago -
Advice to convert MBR to GPT and install Windows 11 Pro on unsupported PC
by
Andy M
8 hours, 19 minutes ago -
Photos from iPhone to Win 10 duplicating/reformatting to .mov
by
J9438
10 hours, 26 minutes ago -
Thunderbird in trouble. Here comes Thundermail
by
Alex5723
8 hours, 35 minutes ago -
Get back ” Open With” in context menus
by
CWBillow
21 hours, 28 minutes ago -
Many AMD Ryzen 9800X3D on ASRock have died
by
Alex5723
1 day, 1 hour ago -
simple general stupid question
by
WSaltamirano
19 hours, 15 minutes ago -
April 2025 Office non-Security updates
by
PKCano
1 day, 12 hours ago -
Microsoft wants to hear from you
by
Will Fastie
12 hours, 22 minutes ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
1 day, 15 hours ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
1 day, 21 hours ago -
Test post
by
Susan Bradley
1 day, 23 hours ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
2 days, 1 hour ago -
SSD shuts down on its own
by
CWBillow
1 day, 16 hours ago -
OneDrive File Sharing Changes
by
David Clark
2 days, 9 hours ago -
OneDrive File Sharing Changes
by
David Clark
2 days, 11 hours ago -
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
1 day, 11 hours ago -
Today is world backup day
by
Alex5723
2 days, 3 hours ago -
Windows .exe on Mint
by
Slowpoke47
8 hours, 1 minute ago -
Reviewing your licensing options
by
Susan Bradley
8 hours, 55 minutes ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
1 day, 8 hours ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
1 day, 4 hours ago -
Making sense of Settings in Windows 11
by
Simon Bisson
1 day, 5 hours ago -
Windows 11 pro fails to log in after upgrading Win 10 pro to Win 11 pro 24h2
by
ben_sitaud
2 days, 9 hours ago -
23H2 / 24H2 / Local v. Microsoft Account.
by
CWBillow
2 days, 6 hours ago -
YouTube Ad Blocker Blocker
by
bbearren
2 days, 7 hours ago -
Obscure historical facts about Windows
by
Cybertooth
2 days, 8 hours ago -
Microsoft Backup
by
Linda2019
2 days 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.