Results 1 to 3 of 3
  1. #1
    David30184 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2014
    Posts
    4

    cascading combo boxes - 1st one works - 2nd won't populate

    I'm using three combo boxes - The second (cbosubSkillList) is limited by value selected in the first (cboSkillList). The third (cboSubSkillList2) to be limited by value selected in the second. The third will not populate - If I comment out the code, It WILL populate will all values, but will not populate with code active. All names, properties, etc. with combo boxes, tables, field names parallel - Why am I not populating the third box?

    [Code]
    Private Sub cboSkillList_AfterUpdate()
    With Me![cboSubSkillList]
    If IsNull(Me!cboSkillList) Then
    .RowSource = ""
    Else
    .RowSource = "SELECT [SubSkill] " & _
    "FROM SubSkillList " & _
    "WHERE [SkillID]=" & Me!cboSkillList
    End If
    Call .Requery
    End With
    End Sub
    *****************************
    Private Sub cbosubSkillList_AfterUpdate()
    With Me![cboSubSkillList2]
    If IsNull(Me!cboSubSkillList2) Then
    .RowSource = ""
    Else


    .RowSource = "SELECT [SubSkill2] " & _
    "FROM SubSkillList2 " & _
    "WHERE [subSkillID]=" & Me!cboSubSkillList
    End If
    Call .Requery
    End With
    End Sub

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    This statement:

    "SELECT [SubSkill] " & _
    "FROM SubSkillList " & _
    "WHERE [SkillID]=" & Me!cboSkillList

    is populating cboSubSkillList with one field - Subskill - which I assume is text, using the value in cboSkillList, which is numeric as selection criteria.

    Now, the statement to populate cboSubSkillList2:

    "SELECT [SubSkill2] " & _
    "FROM SubSkillList2 " & _
    "WHERE [subSkillID]=" & Me!cboSubSkillList

    uses the value in cboSubSkillList, which is text, not numeric, to compare to an ID, so it wont work.

    Try changing your first select to:

    "SELECT [SubSkillID], [SubSkill] " & _
    "FROM SubSkillList " & _
    "WHERE [SkillID]=" & Me!cboSkillList

    so that cboSubSkillList will have a numeric (ID) value. Set the width of column 1 in cboSubSkillList to 0 to hide it.

    HTH

    John

  3. #3
    David30184 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2014
    Posts
    4
    Will try this tonight and respond - Thanks John - seems I have Numeric trying to speak to text (??)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cascading Combo Boxes
    By JCW in forum Programming
    Replies: 4
    Last Post: 04-02-2014, 05:05 PM
  2. cascading Combo boxes
    By Chatholo in forum Forms
    Replies: 2
    Last Post: 08-09-2013, 01:39 AM
  3. Sum of Cascading Combo Boxes
    By alonewolf23 in forum Forms
    Replies: 2
    Last Post: 11-20-2011, 02:10 PM
  4. Cascading combo boxes
    By combine21 in forum Forms
    Replies: 3
    Last Post: 12-02-2010, 12:57 PM
  5. Cascading Combo Boxes
    By gjw1012 in forum Access
    Replies: 1
    Last Post: 07-25-2009, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums