Share via

Parameter Query with combo box

Anonymous
2016-01-15T08:19:58+00:00

Hello,

I'm creating a query based on values from a table and I will like to add a parameter that comes with a dropdown to search for specific records.

Thank you

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2016-01-15T17:51:23+00:00

    You'll find an example of a dialogue form with controls, including combo boxes, referenced by a query as parameters in MultiSelect.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    Note that if you are using an earlier version of Access you might find that the colour of some form objects such as buttons shows incorrectly and you will need to  amend the form design accordingly.  

    If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.

    In this little demo file the button to 'Restrict Report's Underlying Query on One or More Fields' is the appropriate example for what you wish to do.  In the demo the button opens a report based on the query, but could equally well open a form or the query itself.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-01-15T09:21:13+00:00

    Hi,

    to refer to a form combo-box you must use a condition like:

    Forms.formName.comboName

    if you want to obtain a specific column of combo (not the first)  then use

    Forms.formName.comboName.Column(x)

    where x is from 0 (first column) to n-1

    Ciao Mimmo

    Was this answer helpful?

    0 comments No comments
  3. HansV 462.6K Reputation points
    2016-01-15T09:16:07+00:00

    Create a form frmParam.

    Create a combo box cboParam on this form. Set its Row Source to a query or SQL statement that returns the values that you want to display in the dropdown.

    Use [Forms]![frmParam]![cboParam] as parameter in your query.

    This will only work if the form is open when you use the query.

    Was this answer helpful?

    0 comments No comments