Share via

Editing data in a combo box in access

Anonymous
2014-09-17T16:45:20+00:00

I have a combo box on a form in access.  The combo box is populated through code from data in microsoft project.  The row source type is set to value list.  The combo box populates alright, the problem arises when I try to edit the data.  If i select a row in the list box portion of the combo box only the first column shows up in the text box portion.  How do I get this thing to 1:  have the entire row show up in the text box portion of the combo box, and 2: how do i edit a particular column?  Thank you for any help offered.

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

7 answers

Sort by: Most helpful
  1. ScottGem 68,810 Reputation points Volunteer Moderator
    2014-09-18T12:33:13+00:00

    First, you cannot edit the data selected in a combobox. A combobox returns a single value that is represented by the bound column of the control.

    Since, the Rowsource of the combo is a Value List, I'm assuming there is code that populates the RowSource. To help you further with the combo, we would need to see that code.

    Second, if you using the combo to select a record in your Project file and you then need to update a value in that record, then the question becomes how do you link to the Project table? I can't say I've ever tried to use Access as an interface to Project, but I believe you can link to a Project table. If you can, then I would use a subform bound to a query that filters the Project table for the selected record in the combo. You can then display as many or as few fields from the Project table as you need in your subform. You can then unlock the field(s) you want to edit.

    If you are not linking to the Project table, then you must be using Office Automation to handle the transfer of data between Access and Project. We would need to see that code.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-09-17T21:53:50+00:00

    I've never tried to use msproject's data in Access so this is just areas to explore.  Ideally you can link to the project table and then use a query for the combo box's row source.  This should also allow you to update the project data using a (sub)form bound to the linked table.  Check this on a msproject forum.

    If msproject won't accommodate that straightforward approach, then you may have to resort to importing the msproject data into your database (a la you existing code).  Then keep track of the changes so, one way or another, they can be exported back to msproject on a semi regular schedule.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-09-17T17:58:35+00:00

    Thank you for your reply.  What I'm going to do with the data in the combo box is update the units processed in the project file, and save this data to a table to extract yield numbers over time. There is as of now only one column that needs to be edited, that's the number of parts produced.   The rest of data that's included in the combo box is needed to to find the correct line to update in a very large msproject file.  Can this be accomplished with a subform?  Also, when I populate the combo box the amount of rows within it varies with each weeks run, how do you allow for this in a sub form.  Thank you

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-09-17T17:17:56+00:00

    To be able to view more than the first non-zero length column in a combo box, you can do either of three things:

     1 - Add text boxes next to the combo box and set their control source to an expression like:

            =thecombobox.Column(3)

           to display the fourth column in the combo box's row source list.

     2- Add another column to the value list that contains a concatenation of all the other items in

          the row. 

    3 - Use a subform instead of the combo box.  This is ny personal preference, but depending

          on how you are using the combo box, it might get tricky.

    OTOH, trying to edit a value list is very complicated and would most likely involve using a (sub)form.  Because the value list is extracted from external data, any edits you manage to accomplish would only be temporary until the next time you (re)construct the value list.  Remember that a combo box only saves the value in its BoundColumn so I don't understand what you are trying to accomplish by editing any other column.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2014-09-17T16:52:22+00:00

    You need to edit the underlying list in design view, BUT bear in mind all previously entered records will reflect the change.

    Was this answer helpful?

    0 comments No comments