Results 1 to 6 of 6

Thread: combo box

  1. #1
    Join Date
    Dec 2003
    Posts
    27

    Unanswered: combo box

    Hi Group

    I have a form with a subform on it. Is it possible to have a combo box that would limit subform to its selection ?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Oleg123
    Hi Group

    I have a form with a subform on it. Is it possible to have a combo box that would limit subform to its selection ?
    Yes it is possible.
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jun 2004
    Posts
    10
    Howdy

    Add a combo to the form, make sure the Row Source Type property is set to Value list.

    When the form loads add all the form names to the combo box. eg:

    Code:
    Private Sub Form_Load()
        cmbFormSelection.AddItem "Form1"
        cmbFormSelection.AddItem "Form2"
        cmbFormSelection.AddItem "Form3"
    End Sub
    Add the _AfterUpdate() event to control the sub form

    Code:
    Private Sub cmbFormSelection_AfterUpdate()
        SubFormWindow.SourceObject = cmbFormSelection.Text
    End Sub

    HTH

    Geoff
    There are 10 types of people in this world. Those who understand binary and those who don't. - ThinkGeek

  4. #4
    Join Date
    Dec 2003
    Posts
    27
    thank you Geoff
    i added subform to form load event
    not sure how to select the field from it.
    it has to be values from 1 to 4, and the result has to go to subform field AppsID and filter by it

  5. #5
    Join Date
    Dec 2003
    Posts
    27
    Ok, so the combo box now shows only distinct records that are in a column. (1,2,4)
    How do I specify which column of the subform should equal that selection ?

    Private Sub cmbFrm1_AfterUpdate()
    subformwindow.SourceObject = cmbFrm1.Text
    End Sub

  6. #6
    Join Date
    Jun 2004
    Posts
    10
    I am not quite sure what you are asking, basically a sub form control will show a completely different form within the main controlling form. The example works by adding the actual form names to the combo box, therefore when a user changes the combo box selection the selected text is the name of the form that will load.

    How do the numbers 1,2,4 releate to the subforms that you want to load???
    There are 10 types of people in this world. Those who understand binary and those who don't. - ThinkGeek

Posting Permissions

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