Share via

Combobox problem

Anonymous
2022-09-29T19:23:55+00:00

In Access 365 I have a combobox that takes no action when I click on an item. Any ideas why this is happening?

Microsoft 365 and Office | Access | For home | Other

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

18 answers

Sort by: Most helpful
  1. George Hepworth 22,855 Reputation points Volunteer Moderator
    2022-09-29T21:47:43+00:00

    One thing to keep in mind when designing and developing a relational database application using Access is that you are creating a custom application from the basic tools, not following a template with pre-existing functions defined and implemented for you. That said, there are, indeed, many things about Access which are, or can be, somewhat automatic. The latter includes, for example, the automatic saving of a record when you close a form to which that table is bound.

    One of the tricks to becoming an adept Access developer is learning which things are going to be more or less automatic and which things you have to implement via code or other tools.

    Here, it sounds like you missed the fact that you must tell Access what action you want to occur in this combo box. Access takes care of providing the events you can use, but it's on you to actually specify what happens in those events.

    Multiply that over and over throughout the relational database application, and you'll eventually become comfortable making things happen the way you require.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,830 Reputation points Volunteer Moderator
    2022-09-29T21:04:10+00:00

    Thanks for your reply. It's based on a query. When I click on an item it should run the code for that item. I see the combo in design view it says unbound. The control source is blank. The row source is set to the query. Is that the problem? I have to go to work now.

    So, again, what have you done to get it to run the code for that item? Have you put any code in the After Update event of the combo to run the code?

    Please show us the RowSource of the combo.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-09-29T20:59:23+00:00

    If you want to have an action performed when you select an item, from the combo box you must put either a Macro or (better) some VBA code in the After Update event of the combo. View the properties of the combo box; select the Event tab; find the After Update event and click the ... icon there. This will open a VBA editor window with

    Private Sub comboboxname_AfterUpdate(Cancel as Integer)

    End Sub

    Edit this code to perform whatever you want to have happen. In that code you can use the name of the combo box to refer to whatever value the user has selected.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2022-09-29T20:38:36+00:00

    Thanks for your reply. It's based on a query. When I click on an item it should run the code for that item. I see the combo in design view it says unbound. The control source is blank. The row source is set to the query. Is that the problem? I have to go to work now.

    Was this answer helpful?

    0 comments No comments
  5. ScottGem 68,830 Reputation points Volunteer Moderator
    2022-09-29T20:30:52+00:00

    Well the first question is what action are you expecting? The second action is what have you done to perform that action.

    A combobox is a control used to select data from a list. It does nothing more than that unless you do something to do more.

    For example, it won't even save the selected item into a table, unless you have the form bound to a RecordSource and the combo bound to a Controlsource. If you want some action to be performed when you select an item, you have to create code in an event triggered by slecting an item to determine what item was selected and take appropriate action.

    So back to my questions. What do you expoect to happen and what have you done to get that to happen.

    Was this answer helpful?

    0 comments No comments