mulitple Subforms selected from a Combo Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barneymonkeyman
    New Member
    • Apr 2010
    • 2

    #1

    mulitple Subforms selected from a Combo Box

    Firstly, I'm new to Access and VB code and what i do know is completely self taught from helpand websites like this, so be gentle.

    I want to have a subform displayed depending on a selection within a Combo box on the mainform

    Its a student database, the combo box is the specific course there on(STC), the subform would then ideally display the phases of that course, with fields such as mark, course notes, Exam paper, instructor, invigilater.

    The only difference in the subform is the phase.

    I have already created it so you can enter all the info manually, i'm just trying to make the whole process quicker.

    My fields are as follows:
    The link between the two is the cert number

    -Student Deatils (mainform)
    ---Cert No
    ---STC

    -Exam Results Subform
    ---Cert No (hidden from view)
    ---Phase
    ---Exam Mark
    ---Course Notes
    ---Exam Paper
    ---Instructor
    ---Invigilator

    Finally my question, How do i auto populate the phase of the subform depending on the STC selected from the masterform and still be able to populate the other fields manually? Its where/what source code i'm using for the phase to hold it with the appropriate Cert No and the other subform fields.

    I added an after update event, which selects the appropriate subform, that seems to work, but the info stored on the subform is always the same as the original subform and not my adapted subform. It always displays Exam Results Subform and not subfrm phase 3104, Its like the source code i have seleced in the Exam Results Subform is overwriting whats on the subfrm 3104.

    I'm sure its very simple and basic but i'm suffering from database overload at the moment and can't see the woods for all the trees.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    I'd like to help but I cannot follow the question well as there are too many terms I'm simply not familiar with.
    Its a student database, the combo box is the specific course there on(STC),
    Is that "...they're on"?
    What is (STC)?
    I want to have a subform displayed depending on a selection within a Combo box on the mainform
    A specific subform yes/no? Or one of many determined by the ComboBox?
    The only difference in the subform is the phase.
    Phase?
    What difference?
    Cert No
    I'm guessing this is not a Student ID. Does it refer to just one of their courses? I guess it must be student related somehow.

    I know this is all new to you, and I don't want to put you off before you've even started (far from it - You've clearly put thought and effort into asking the question), but hopefully you can see some of the common pitfalls when asking questions of people whose only information is what you give them. The clearer and less ambiguous (without being at all long-winded) you make the question the quicker and more reliable will be the responses.

    Welcome to Bytes!

    Comment

    • barneymonkeyman
      New Member
      • Apr 2010
      • 2

      #3
      Firstly, Sorry, having re read i can see exactly what you mean.

      sry for the bad english on my part, it is "they're on"

      STC = Course Number which is a 4 digit figure such as 3433 or 3118.

      Each course is different, so 3433 has 6 phases whilst 3118 has 2, it would be one of many subforms which is dictated by the combo box selection.

      To explain the phases ill break it down,
      STC 3433 has 6 phases, Fuel, Computers, Maths, English, Engines 1, Engines 2. The subform would display as a mini spread sheet, phases on left with the instructer, invigilator, course notes, course exam ect displayed across the top.

      The certificate number (Cert No) is used as it will be different for every student of every course, they are only used once, this allows students to attend multiple courses over a period of time and hold how they did in each phase of that course without mixing all the information together.

      Thanks for the advice and taking the time to ask for clearer information.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        OK. That's a pretty good answer. I find myself understanding much better the environment in which your project is working. I'm assuming that the Student Details form actually reflects a Certificate level entity rather than a Student. IE. It would identify both the student and the course. Also, that each Phase of a certificate (Student/Course) is held as a separate record in the record source of the Exam Results form IE unique identification for the records is both [Cert No] and [Phase].

        All that being valid, I would suggest the record source of the subform be filtered, within its design, on the value returned by the Phase ComboBox on the main form. See Referring to Items on a Sub-Form for help on that. If you struggle then post the names of the various items (controls and fields) and we'll do what we can to help.

        Comment

        Working...