Results 1 to 8 of 8
  1. #1
    mar_t is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Nov 2010
    Posts
    52

    Combo box value that display another selection

    I have a combo that contains 10 selection, let say 1,2,3,4,5,6,7,10. If I select 1, it will display another set of selection..like 1a,1b,1c....etc. Once I select 1a it will open my report form.

    Is this possible?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Presumably you mean with a second combo. If so, the concept is called cascading combos:

    Baldy-Cascading Combos

    If you want to open a form/report restricted to that chosen value:

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mar_t is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Nov 2010
    Posts
    52
    Hi pbaldy,
    Instead of two combo box, I was thingking using just only one combo box (see attached graphic) but I dont know how. Is this possible in ms access?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You could do that with a menu; not sure about a combo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    mar_t is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Nov 2010
    Posts
    52
    Noted, I was trying to create a third cascading combo box but I'm unable to pull it through. Would appreciate if you could show me the codes for the third combo box (ie. cboSubcity).

    thanks

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It would be basically the same. What have you got that isn't working?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    mar_t is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Nov 2010
    Posts
    52
    Below is my code, I'm sure I'm not doing it right. My 3rd combo is cboSubUnit...help.

    Code:
    Private Sub cboSection_AfterUpdate()
    Dim strSelect     As String
     
     strSelect = "SELECT Unit, SubUnit" & _
                 "FROM tblCompany" & _
                 "WHERE Section = '" & Me.cboSection & "' ORDER BY Unit, SubUnit"
     Me.cboUnit.RowSource = strSelect
     Me.cboUnit = vbNullString
     
    End Sub

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You haven't said what the problem is, but you appear to have made the fairly common error of failing to include spaces when going from one line to another. Try:

    Code:
    strSelect = "SELECT Unit, SubUnit " & _
                 "FROM tblCompany " & _
                 "WHERE Section = '" & Me.cboSection & "' ORDER BY Unit, SubUnit"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 01-24-2011, 07:11 PM
  2. Pop-up Combo Box Record Selection
    By AKQTS in forum Forms
    Replies: 1
    Last Post: 08-11-2010, 01:01 PM
  3. Combo Box that doesn't allow selection
    By Ted C in forum Forms
    Replies: 20
    Last Post: 08-09-2010, 04:00 PM
  4. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  5. Replies: 3
    Last Post: 02-26-2009, 10:17 AM

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