opening a form from a combo box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aravind

    opening a form from a combo box

    Hi folks.

    I have a combo box with a list of names. I want to be able to click
    (or press "enter" on) a name, which will open a separate form which
    shows a group of records that corresponds to that name (e.g. "Borrow
    History" table/query with its corresonding form, which holds the
    details of books borrowed by that particular person). Any suggestions
    on how I might be able to achieve this? Thank you.
  • Bradley

    #2
    Re: opening a form from a combo box

    Aravind wrote:[color=blue]
    > Hi folks.
    >
    > I have a combo box with a list of names. I want to be able to click
    > (or press "enter" on) a name, which will open a separate form which
    > shows a group of records that corresponds to that name (e.g. "Borrow
    > History" table/query with its corresonding form, which holds the
    > details of books borrowed by that particular person). Any suggestions
    > on how I might be able to achieve this? Thank you.[/color]

    It's quite simple.

    Use the value from the ComboBox (eg. PersonID) and build a Where value
    to open the form with.

    eg. (VB code) Docmd.OpenForm "frmMyForm" ,,, "[PersonID] = " &
    Me![cboSelectPerson ID]

    (Check the position of the Where clause in the Help, I've guessed the
    commas./etc above :)

    You can use a macro to achieve the same thing if that is easier for you.

    eg. In the macro enter something like this for the Where value on the
    OpenForm action

    "[PersonID] = " & Forms![MyForm]![cboSelectPerson ID]

    Hope that gives you a start...
    --
    regards,

    Bradley


    Comment

    Working...