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
-
Is there a comprehensve way to tranfer ALL current Edge Settings into a new Edge
by
Tex265
1 hour, 7 minutes ago -
Transferring ALL info/settings from current Firefox to new computer Firefox
by
Tex265
2 hours, 29 minutes ago -
DOGE Wants to Replace SSA 60 Million Line COBOL Codebase in Months
by
EyesOnWindows
2 hours, 47 minutes ago -
KB5051989 Usb printer Post Ipp
by
licencesti
1 hour, 29 minutes ago -
Removing bypassnro
by
Susan Bradley
1 hour, 30 minutes ago -
Up to 30 seconds to show “Recent Topics”
by
PL1
5 hours, 50 minutes ago -
Sound changes after upgrade from W11 23H2
by
WStaylorpsepa
7 hours, 34 minutes ago -
Windows bug blocks BIOS updates for Lenovo ThinkPad laptops
by
Alex5723
10 hours, 36 minutes ago -
O&O Software – ‘World Backup Day’ Sale
by
unbob
6 hours, 56 minutes ago -
Still version 23H2?
by
WSbxcfilm
11 hours, 24 minutes ago -
Ubuntu 25.04 (Plucky Puffin) Beta released
by
Alex5723
17 hours, 21 minutes ago -
How to install App Store apps on an external SSD
by
Alex5723
18 hours, 15 minutes ago -
Where is Windows going?
by
Susan Bradley
8 hours, 32 minutes ago -
Installing Feature Update Windows 11 24H2
by
geekdom
1 day, 11 hours ago -
Windows 11 Insider Preview build 27823 released to Canary
by
joep517
1 day, 12 hours ago -
Windows 11 Hotpatch
by
Hackmuss
19 hours, 25 minutes ago -
System Guard service error still won’t be fixed
by
Susan Bradley
1 day, 12 hours ago -
Operation ForumTroll: APT attack with Google Chrome zero-day exploit chain
by
Alex5723
1 day, 6 hours ago -
Troy Hunt of HaveIBeenPwned Phished
by
Lars220
1 day, 3 hours ago -
Microsoft Windows security auditing Code 5061
by
mpw
2 days, 1 hour ago -
Can’t display images in incoming Outlook 365 emails
by
WScopwriter
1 day, 8 hours ago -
Windows 11 Insider Preview Build 26200.5510 early builds of 25H2
by
Alex5723
1 day, 10 hours ago -
0Patch : Micropatches released for SCF File NTLM Hash Disclosure Vulnerability
by
Alex5723
1 day, 9 hours ago -
Select multiple emails and they all open up!
by
CeeJay
3 days, 2 hours ago -
How to remove an update preview
by
Gunny
1 day, 5 hours ago -
Third party add ins reminder
by
Susan Bradley
11 hours, 58 minutes ago -
OTF, which backs Tor, Let’s Encrypt and more, sues to save its funding
by
Nibbled To Death By Ducks
2 days, 20 hours ago -
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
3 days, 6 hours ago -
How can I update “Explorer Patcher”
by
WSplanckster
3 days, 8 hours ago -
Check out the home page for Signal
by
CAS
3 days, 6 hours ago
Recent blog posts
- Removing bypassnro
- Where is Windows going?
- System Guard service error still won’t be fixed
- Third party add ins reminder
- MS-DEFCON 4: Mixed bag for March
- Classic and Extended Control Panel — no need to say goodbye
- Things you can do in 2025 that you couldn’t do in 2024
- Revisiting Windows 11’s File Explorer
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.