473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Combo with Select Row Query with Multiple ID numbers.

I have the current code for populating one combo box off another combo box:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo110_AfterUpdate()
  2.   With Me![Combo112]
  3.     If IsNull(Me!Combo110) Then
  4.       .RowSource = ""
  5.     Else
  6.       .RowSource = "SELECT [Root_Cause] " & _
  7.                    "FROM xRoot_Cause " & _
  8.                    "WHERE [ID]=" & Me!Combo110
  9.                           End If
  10.     Call .Requery
  11.   End With
  12. End Sub
My question is if Root_Cause has multiple Ids from table me!Combo110 can it work ?
Feb 18 '10 #1
1 2291
Stewart Ross
2,545 Expert Mod 2GB
Hi again.

When you reference the value property of combo Me!Combo110 you are retrieving whatever single item element is set as its current value. Unlike a list box which you can set to allow multi-select, combos return single values only.

You have already guarded aginst a null (when no selection has yet been made), so your combo will contain a value. The number of other values in the source of the combo will not affect what is selected. Your Where clause should work OK as long as the value in the combo does match an ID in your xroot_cause table; if not, no rows will be returned by your SELECT statement.

If the ID in your xroot_cause table is not unique (depending on what you mean by 'multiple IDs from the root cause table) then multiple rows will be returned by your WHERE clause as the rowsource for your next combo.

I presume you do not mean table me!combo110 (as the combo is not a table) but whatever table or query is the rowsource for combo110.

-Stewart
Feb 18 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To...
1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
2
by: Sreya | last post by:
Hello..I hope someone can help me with this little that I've been having for a while. I have a form..which has many fields. one of them being a test #. what I need a combo box with only certain...
4
by: RBohannon | last post by:
I'm using Access 2000. I currently have a report being generated using the results of a query by form. The form used for this query is an unbound form, frmListDialog. frmListDialog contains...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
2
by: isetea | last post by:
Hi, I have created a form, which shows values in a combo box and a button with the following code behind: Private Sub Open1_Click() On Error GoTo Err_macro1_Click Dim db As...
4
by: Swinky | last post by:
I am trying to make a combo box dependent on a text box. I cannot get the combo box to pull the related data from the text box. I have been all over this user group & have tried several versions...
4
by: AXESMI59 | last post by:
have a project in which I am entering Serial Numbers and Date codes into a Combo box. Serial numbers are all different. However, they could each have the same Date Code. Each Serial Number has a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.