Two search comboboxes on a main form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zamir
    New Member
    • Feb 2007
    • 10

    Two search comboboxes on a main form

    hi, i was wondering if its possible to have two combo boxes searching information on the main form (NO subform).

    i have one combo box that finds the student and the second one to find the subject the student is taking.

    but once i find the student the second combo box doesn't work. why?

    this is the code i used for each combo box

    Private Sub cboFindStudent_ AfterUpdate()
    DoCmd.ShowAllRe cords
    DoCmd.FindRecor d Me!cboFindStude nt
    Me!cboFindStude nt.Value = ""
    End Sub

    Thanks
  • zamir
    New Member
    • Feb 2007
    • 10

    #2
    Originally posted by zamir
    hi, i was wondering if its possible to have two combo boxes searching information on the main form (NO subform).

    i have one combo box that finds the student and the second one to find the subject the student is taking.

    but once i find the student the second combo box doesn't work. why?

    this is the code i used for each combo box

    Private Sub cboFindStudent_ AfterUpdate()
    DoCmd.ShowAllRe cords
    DoCmd.FindRecor d Me!cboFindStude nt
    Me!cboFindStude nt.Value = ""
    End Sub

    Thanks
    of course i didn't use cboFindStudent on the second one, sorry i forgot to mention.

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Have a look at this tutorial and come back if you have any questions.

      Cascading Combo/List Boxes

      Mary

      Comment

      • zamir
        New Member
        • Feb 2007
        • 10

        #4
        Originally posted by mmccarthy
        Have a look at this tutorial and come back if you have any questions.

        Cascading Combo/List Boxes

        Mary
        I've done the tutorial, but that was about selection one combo box to filter another combo box, my initial problem is that i used a wizard to create a form from a query, where a teacher can enter student marks and on that form i had two combo boxes each with the following code.

        Private Sub cboFindStudent_ AfterUpdate()
        DoCmd.ShowAllRe cords
        DoCmd.FindRecor d Me!cboFindStude nt
        Me!cboFindStude nt.Value = ""
        End Sub

        Private Sub cboFindSubject_ AfterUpdate()
        DoCmd.ShowAllRe cords
        DoCmd.FindRecor d Me!cboFindSubje ct
        Me!cboFindSubje ct.Value = ""
        End Sub

        what i want to do is to find the student and then find the subject he/she is taking and then enter the marks.

        the first combo works, but the second doesn't find the subject. Keeping in mind that i used a wizard.

        Thanks

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by zamir
          I've done the tutorial, but that was about selection one combo box to filter another combo box, my initial problem is that i used a wizard to create a form from a query, where a teacher can enter student marks and on that form i had two combo boxes each with the following code.

          Private Sub cboFindStudent_ AfterUpdate()
          DoCmd.ShowAllRe cords
          DoCmd.FindRecor d Me!cboFindStude nt
          Me!cboFindStude nt.Value = ""
          End Sub

          Private Sub cboFindSubject_ AfterUpdate()
          DoCmd.ShowAllRe cords
          DoCmd.FindRecor d Me!cboFindSubje ct
          Me!cboFindSubje ct.Value = ""
          End Sub

          what i want to do is to find the student and then find the subject he/she is taking and then enter the marks.

          the first combo works, but the second doesn't find the subject. Keeping in mind that i used a wizard.

          Thanks
          Both of these are doing the same thing and have the same name. Are both combo boxes exactly the same and if so why have you got two of them?

          Comment

          • zamir
            New Member
            • Feb 2007
            • 10

            #6
            Originally posted by mmccarthy
            Both of these are doing the same thing and have the same name. Are both combo boxes exactly the same and if so why have you got two of them?
            i guess they are the same in terms of code but the combo boxes are different one lists all the students and the second one lists all the subjects.

            once i find a particular student, then find the subject and enter marks, but i'm guessing now to go a diffrent route.

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Originally posted by zamir
              i guess they are the same in terms of code but the combo boxes are different one lists all the students and the second one lists all the subjects.

              once i find a particular student, then find the subject and enter marks, but i'm guessing now to go a diffrent route.
              Have a look at this other tutorial which may be more appropriate to your needs.

              Example Filtering on a Form

              Mary

              Comment

              Working...