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
-
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
55 minutes ago -
Today is world backup day
by
Alex5723
2 hours, 3 minutes ago -
Windows .exe on Mint
by
Slowpoke47
23 minutes ago -
Reviewing your licensing options
by
Susan Bradley
36 minutes ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
1 hour, 32 minutes ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
2 hours, 9 minutes ago -
Making sense of Settings in Windows 11
by
Simon Bisson
4 hours, 15 minutes ago -
Windows 11 pro fails to log in after upgrading Win 10 pro to Win 11 pro 24h2
by
ben_sitaud
1 hour, 38 minutes ago -
23H2 / 24H2 / Local v. Microsoft Account.
by
CWBillow
15 hours, 8 minutes ago -
YouTube Ad Blocker Blocker
by
bbearren
4 hours, 32 minutes ago -
Obscure historical facts about Windows
by
Cybertooth
1 hour, 40 minutes ago -
Microsoft Backup
by
Linda2019
11 hours, 53 minutes ago -
What is the best notepad++ version for W7?
by
Picky
22 hours, 3 minutes ago -
What are right steps to move MS 365 Office+OneDrive files from PC to iMac?
by
glnz
1 day, 5 hours ago -
How to move existing MS 365 Office with OneDrive files from PC to new iMac
by
glnz
1 day, 5 hours ago -
How to move MS 365 files (some on OneDrive) from PC to iMac
by
glnz
2 days ago -
Microsoft adding Quick Machine Recovery to Windows 11
by
Alex5723
2 days ago -
Microsoft vs Passwords
by
Alex5723
1 day, 8 hours ago -
Windows 11 Insider Preview build 26200.5516 released to DEV
by
joep517
2 days, 4 hours ago -
Windows 11 Insider Preview build 26120.3653 (24H2) released to BETA
by
joep517
2 days, 4 hours ago -
Two March KB5053606 updates?
by
Adam
1 day, 21 hours ago -
MS Edge Not Updating to v134.0.3124.95 (rel. 27-Mar-2025)
by
lmacri
1 day, 22 hours ago -
Intel® Graphics/Sound Driver updates for 7th-10th Gen Intel® Core™ Processor
by
Alex5723
2 days ago -
Is there a comprehensve way to tranfer ALL current Edge Settings into a new Edge
by
Tex265
1 day, 23 hours ago -
Transferring ALL info/settings from current Firefox to new computer Firefox
by
Tex265
1 day, 22 hours ago -
DOGE Wants to Replace SSA 60 Million Line COBOL Codebase in Months
by
EyesOnWindows
5 hours, 14 minutes ago -
KB5051989 Usb printer Post Ipp
by
licencesti
2 days, 16 hours ago -
Removing bypassnro
by
Susan Bradley
11 minutes ago -
Up to 30 seconds to show “Recent Topics”
by
PL1
1 day, 20 hours ago -
Sound changes after upgrade from W11 23H2
by
WStaylorpsepa
21 hours, 32 minutes 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.