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

    Unanswered: Another Cascading combo box issue

    I created a table called the Family_Hours (look up table for a compbox) and how its suppose to look is when there is a
    this is the type of family and due to how many chidren they have and if dad is at home then that determines how many hours they are responsible for per week and month

    Two Parent Family - Weekly Hours = 40 Montly Hours= 173
    so this is how I put the data in the table

    1 Single Parent w/child 1 to 6 yrs 20 87 NULL
    2 Single Parent w/child 6 yrs & up 30 130 NULL
    3 Two-Parent Family 40 173 NULL
    4 Non-Needy 0 0 NULL
    5 Disregarded 0 0 NULL
    6 Exempt 0 0 NULL


    the users wants to choose what kind of family it is then have the hours automatically pop up in the drop down. I hope that makes sense??
    The part with the family is called TypeofParticipant the lower numbers are WeeklyHours and the Higher numbers are Montly totals


    Code:
    CREATE TABLE [dbo].[FamilyHours_tbl](
    	[FamilyHrID] [int] IDENTITY(1,1) NOT NULL,
    	[TypeOfParticipant] [nvarchar](50) NULL,
    	[WeeklyHours] [int] NULL,
    	[MonthlyHours] [int] NULL,
    	[ParentID] [nvarchar](50) NULL,
     CONSTRAINT [PK_FamilyHours_tbl] PRIMARY KEY CLUSTERED 
    (
    	[FamilyHrID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I'd like to help but I do not understand the question, sorry.
    I hope that makes sense??
    Not really, to me anyway. What precisely is your question and what does the SQL definition of a tables concerns a combo box?
    Have a nice day!

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I am trying to make one combo box populate another, when the user chooses TypeofParticipant combo box(which is the family types) then their instead of them choosing the Monthly Hours and Weekly hours that are required for that family, the combo boxes would jsut be populated for them. but they would be based on the type of family

    2 parent family = Weekly_hrs 40 Hours and Month 173 Hours
    single parent child over 6 years = Weekly_hrs 30 hours and Month 130 Hours
    sigle parent child under 6 years = Weekly_hrs 20 hours and Month 87 Hours
    child under 1 year = Weekly_hrs 0 hours and Month 0 Hours

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    All right, it's seems clearer now, but just a little bit (I'm slow sometimes ).

    Let's see:

    Combo1.RowSource = "SELECT FamilyHrID, TypeOfParticipant, WeeklyHours, MonthlyHours FROM FamilyHours_tbl"
    Combo1.ColumnCount = 4
    Combo1.ColumnWidths = 0cm;2,503cm;0cm;0cm (sorry: in centimetres here!)
    Combo1.BoundColumn = 1
    Combo1.LimitToList = True

    Combo2.RowSource = "SELECT FamilyHrID, WeeklyHours FROM FamilyHours_tbl"
    Combo2.ColumnCount = 2
    Combo2.ColumnWidths = 0cm;2,503cm
    Combo2.BoundColumn = 2
    Combo2.LimitToList = True

    Combo3.RowSource = "SELECT FamilyHrID, MonthlyHours FROM FamilyHours_tbl"
    Combo3.ColumnCount = 2
    Combo3.ColumnWidths = 0cm;2,503cm
    Combo3.BoundColumn = 2
    Combo3.LimitToList = True

    Code:
    Private Sub Combo1_AfterUpdate()
    
        Me.Combo2 = Me.Combo1.Column(2)
        Me.Combo2.SetFocus
        Me.Combo2.Dropdown
        Me.Combo3 = Me.Combo1.Column(3)
        Me.Combo3.SetFocus
        Me.Combo3.Dropdown
        Me.Combo1.SetFocus
        
    End Sub
    What I do not understand (if I got your question right) is why you need Combo2 and Combo3, as the full information can be held in Combo1. Did I miss something?
    Have a nice day!

  5. #5
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I keep getting an error message when trying to put in the column widths. I put in an attachement the error message I'm getting. can you tell me what I'm doing wrong
    Attached Files Attached Files

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    If your local settings use inches as units you have to specify the width of the column in inches, not in centimeters (1 inch = 2.54 cm).
    Have a nice day!

  7. #7
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    what do you mean by column(2) are you talking about the name of the fields??? or no

  8. #8
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Hello here is the code, when tried it I didnt get an error message jsut that when I choose a family type from the first combo box nothing happened the form blinked and thats it nothing happened


    Private Sub TypeOfParticipant_AfterUpdate()
    Me.Weekly = Me.TypeOfParticipant.Column(2)
    Me.Weekly.SetFocus
    Me.Weekly.Dropdown
    Me.Month = Me.TypeOfParticipant.Column(3)
    Me.Month.SetFocus
    Me.Month.Dropdown
    Me.TypeOfParticipant.SetFocus


    End Sub

  9. #9
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Have a look at the Form_IPCombos form in the attached database. It does not precisely do what you want but the principle is the same.
    Attached Files Attached Files
    Have a nice day!

  10. #10
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    finally I got it thank you so much for your help

  11. #11
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Can I apply this same thing to another cascading combo task I have been given. The users want the ability to put in a code like 1a or 2b and in the other two combo boxes named ServicesCovered and Category, the values associated with those codes would pop up in the combo boxes. I am unsure as to how to do this, I left a example in pdf fomat of an example. I hope this makes sense. Any help you could give would be much appreciated, thank you

    Example:

    1a
    Category Services Covered
    ITP Academic Assessment


    1b
    Category Services Covered
    ITP MER Completiong - TANF

    1c
    Category Services Covered
    ITP Career Training Plan

    1d
    Category Services Covered
    ITP Counseling


    1e
    Category Services Covered
    ITP Phone Call
    Attached Images Attached Images

Posting Permissions

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