General discussion

  • Creator
    Topic
  • #2092365

    Access Combo Box

    Locked

    by mahunsaker ·

    I have a msaccess database which has a query that open a form. I want to use a combo box to enter the parameter criteria for the query. Example: table-assigned responsible; query-open/in progress by responsible (when the query executes now it displays a box saying “Enter Assigned Responsible” and has a blank for the input) I want it to display the same input box, but with a combo box as the entry tool so the user can only enter the items from within the [assigned responsible] table.

All Comments

  • Author
    Replies
    • #3878801

      Access Combo Box

      by shmaltz ·

      In reply to Access Combo Box

      I think that the only way to do that would be to call a function that in turn calls a form that returns the parameter to the function and then the function returns it to the query.
      Anyhow i dont see any reason why you would open a query from the query tab use a form instead that calls the query and put the parameter options on the form that way when a user opens the query the query will not ask for the parameter since the form gave it allready to the query.

    • #3878610

      Access Combo Box

      by mahunsaker ·

      In reply to Access Combo Box

      Poster of Question: I failed to mention that the query is being used to open a set of records based on the input of the query criteria. Therefore the recordset the query opens is in direct correlation to the information entered into the “Enter Assigned Responsible” it then opens a record set based on the person entered into the input area. That is why I want to display a combo box for the user to choose the appropriate person from the list which already exists in the table-[Assigned Responsible]. The main problem with not allowing the selection from an existing list of names is that spelling is one issue, we also want to maintain a finite number of responsible parties; therefore the combo box would also have the property “limit to list”set to Yes and would preclude the user from getting the error message “Entry not is list (etc…).

    • #3878562

      Access Combo Box

      by glen_mcleod ·

      In reply to Access Combo Box

      Start with an unbound form. Create and populate you combo box with the appropriate information. In the “_Change” event, use the information in the combo box to build your SQL statement. Then assign the SQL statement to the form’s RecordSource property. You may have to refresh your form and re-bind your controls.

      Glen

    • #3878474

      Access Combo Box

      by mahunsaker ·

      In reply to Access Combo Box

      Point value changed by question poster.

    • #3869264

      Access Combo Box

      by andrewf ·

      In reply to Access Combo Box

      Hi,

      Why not contain all the information on one form ?

      Make a form, drop a combo box onto it that has a query source showing all possible employee id’s/names. Then make a query based on ‘assigned responsible’ which contains as a column the id or assigned name. Add criteria to the assigned name column and set it to point at the form’s combo box ( eg = [myForm].[myComboBox].value ). All you need to do now is base a control’s recordsource on that query (for example a listbox on that same form) , and add a button to requery the control. If you are a programmer, you could set the click event of the combo box to refresh the query (and of course there a lot of more complicated ways to do this, but this one results in less code)

      Hope this helps

      Andrew Fraser

    • #3841439

      Access Combo Box

      by mahunsaker ·

      In reply to Access Combo Box

      This question was closed by the author

Viewing 5 reply threads