Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9080191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:01:16+00:00 2026-06-16T20:01:16+00:00

I have 2 combo boxes on a Form. ComboID and ComboName ComboID contains items

  • 0

I have 2 combo boxes on a Form. ComboID and ComboName

ComboID contains items such as 1001, 1002, 1003, 1004 etc…
ComboName contains items such as John, Matt, David, Luke etc…

I have a table with this data:
1001, John
1002, Matt
1003, David
1004, Luke

I want ComboID to display 1001 when I select John from ComboName.
And I also want ComboName to display ‘1002’ when I select Matt.

I need to be able to select a new Name or ID at any point and have its corresponding value update in the other combo-box.

I’m stuck with trying to get this to work and it can’t be as hard as I’m making it out to be. I am still learning VBA code. Any help please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:01:17+00:00Added an answer on June 16, 2026 at 8:01 pm

    First Glance Solution (not recommended)

    What it Was

    My initial reaction to this problem was to try and use a change event. Setting up subroutines for each combobox to change the value of the other combobox would have then been the solution.

    Why you shouldn’t use it

    However, in the documentation for the Access vba change events (link above) it clearly states:

    “Avoid creating two or more controls having Change events that affect each other — for example, two text boxes that update each other” (msdn access vba change event)

    Unfortunately, this is exactly what you would be doing using the change event solution (using comboboxes instead of text boxes). In your example, a change in the ComboID combobox would trigger the appropriate change in the ComboName combobox, but that change in the ComboName combobox would trigger an attempted change in the ComboID, and this loop could continue on. Therefore, this is not a good answer to your problem.

    A Better Solution

    An AfterUpdate Event appears to be the more appropriate approach to use in this case.

    Why the problematic loop won’t be triggered

    As mentioned in the AfterUpdate documentation:

    Changing data in a control by using Visual Basic or a macro containing the SetValue action doesn’t trigger these events for the control.

    Therefore, an AfterUpdate Event (possibly using a SetValue) should be a much better approach.

    Much thanks to @Remou for pointing out the error of my change event ways and bringing the AfterUpdate event to my attention.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this form that has tons of text boxes, combo boxes, etc.
I am using windows application and I have four combo boxes(comboeventname,combosendtype,comboType,comboschedule) in that form....
I have a form with two combo boxes and couple of buttons. One of
I have three combo boxes: cbo_prefRoom1, cbo_prefRoom2, cbo_prefRoom3 . On form initialisation cbo_prefRoom2 and
I have in a form two combo boxes that have the exact itemssource property.
I have a combo box and several text boxes on a form. When I
I have two combo boxes in an html form that are going to be
I have a form with sixteen combo-boxes, each with the DropDownStyle property set to
I have a form that needs to use two combo boxes but the values
Let's say I have a form with some text boxes and combo boxes on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.