Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: One combo box dependent on another

    Hi all, I am trying to make the rowsource of the Services_Covered combo box
    dependent on the Catagory_for_hours combo box and I am wondering if I di this correctly. The bosses want the rowsource to be exact, hope I'm doing this right


    Code:
    Private Sub Catagory_for_hours_AfterUpdate()
    
    
     Select Case Me!Catagory_for_hours
       Case "ITP"
         Me!Services_Covered.RowSource = "Academic Assessment;MER Completion - TANF;Career Training Plan;Counseling;Phone Call"
       Case "Parenting"
         Me!Services_Covered.RowSource = "EHS Training/Home Visit;Training/Office Visit;Independent Study"
       Case "Job Skills Training"
         Me!Services_Covered.RowSource = "Independent Job Skills Training;Career Training Workshop;Resume Writing"
         Case "Culture"
         Me!Services_Covered.RowSource = "SCAIR Soaring Eagles;Regalia;Pow Wow Participation"
         Case "Education"
         Me!Services_Covered.RowSource = "GED/High School Diploma Preparation;Adult Basic Education;Independent Study"
         Case "Life Skills"
         Me!Services_Covered.RowSource = "Drivers Education"
         Case "Travel"
         
    
     End Select
    
    End Sub

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    My only question is why are you hard coding a series of value lists into the box instead of tabling/querying them? This is going to be a pain for you/the next programmer if/when an update is needed, and updates are always needed.
    Me.Geek = True

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I am wondering if I di this correctly
    Does it work?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    got a message saying that access couldnt find Catagory_for_hours this is the part that was in highlight, I was just look for some proof reading I guess, I am new to vba

    Private Sub Catagory_for_hours_AfterUpdate()

  5. #5
    Join Date
    Oct 2005
    Posts
    34
    Try this:

    Me!Services_Covered.RowSourceType = "Value List"
    Me!Services_Covered.RowSource = "Academic Assessment;MER Completion - TANF;Career Training Plan;Counseling;Phone Call"

    Repeat for all other entries. I do this as well for some of my combo boxes when I know there will not be frequent updates to them.

  6. #6
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    thankyou wysiwg600 I appreciate it.
    just to make sure I am doing this correctly. I have two combo boxes and I put the code in the Cataogory_for_hours combo box because the services_covered is the subcatagorie. the Services_covered is based off of the Catagory_for_hours. So I was wonderirng do I replace with what you said to do??

    Private Sub Catagory_for_hours_AfterUpdate()


    Select Case Me!Catagory_for_hours
    Case "ITP"
    Me!Services_Covered.RowSource = "Academic Assessment;MER Completion - TANF;Career Training Plan;Counseling;Phone Call"
    Case "Parenting"
    Me!Services_Covered.RowSource = "EHS Training/Home Visit;Training/Office Visit;Independent Study"
    Case "Job Skills Training"
    Me!Services_Covered.RowSource = "Independent Job Skills Training;Career Training Workshop;Resume Writing"
    Case "Culture"
    Me!Services_Covered.RowSource = "SCAIR Soaring Eagles;Regalia;Pow Wow Participation"
    Case "Education"
    Me!Services_Covered.RowSource = "GED/High School Diploma Preparation;Adult Basic Education;Independent Study"
    Case "Life Skills"
    Me!Services_Covered.RowSource = "Drivers Education"
    Case "Travel"


    End Select

    End Sub

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Would it have anything to do with the fact that Category is not spelled Catagory?

    Do you have an object called Catagory_for_hours ?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    No there really is a field named Catagory_for_hours

  9. #9
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    A field maybe, but what about a FORM OBJECT with that exact name?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  10. #10
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    no I looked nothing with the exact same name.

  11. #11
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Well... that would be why you get the message

    got a message saying that access couldnt find Catagory_for_hours this is the part that was in highlight, I was just look for some proof reading I guess, I am new to vba

    Private Sub Catagory_for_hours_AfterUpdate()
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •