Results 1 to 3 of 3

Thread: Combo Boxes!

  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    284
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Boxes!

    [img]/w3timages/icons/crybaby.gif[/img] I'm having a real problem with combo boxes. I guess I don't really understand them (e.g. Control Source, Row Source, etc.). I am trying to make a database for Student's Fees. So when you go into a certain student, you have a subform in which you select from a combo box the fee name (Elementary, Jr. High, Student Council fees). So each student could have a few fees listed, and I want each set of fees to stay with the student. I just can't get it to work. I have tables called Student, FeeTable, and FeeTypeTable. Can anyone help?

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Winnipeg, Canada
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxes!

    [img]/w3timages/icons/shy.gif[/img]I am so new here and so Access green, that I shouldn't do this. But, ah what the heck.

    If I understand you correctly, each time you change a student, you want the combo box to be updated with the types of fees applicable for that student. Right?

    Seems to me that you should have a query inserted in the row source that loads a SQL selected recordset of fee types based on a student into the combo list.

    How? Haven't got a clue (yet). If you know this already and have been trying this, I am slinking away quietly.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Boxes!

    It sounds like you need a structure like this, where StudentID is presumed to the the primary key of tblStudent and FeeID is presumed to be the primary key of tblFee:

    <pre>tblStudent tblStudentFee tblFee
    StudentID--------->StudentID
    FeeID<----------FeeID</pre>


    So your tblStudentFee would contain one record for each combination of StudentID and FeeID. That way you could record as many fees as applied to a particular student. This is commonly called a Many-to-Many join. The combination of StudentID and FeeID should create a unique key in tblStudentFee so that you don't accidentally get the same fee in twice.

    You wouldn't use a combbox except perhaps to select which fee or fee type (that wasn't clear from the question) should be assigned to a particular student for that particular instance of student and fee. You would use a subform, and the subform would be based on the tblStudentFee, with the default value of the control for the StudentID set to something like
    <pre> =Parent![txtStudentID]</pre>


    You would link the parent form and the subform on the StudentID fields in both tables.
    Charlotte

Posting Permissions

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