-2

This question already has an answer here:

How do you update the python addin wizard code to write directly into access or pgdb? I have a combo box and need to have my users enter data into the combobox to write into the database. Can someone provide an example of how to accomplish this task?

marked as duplicate by underdark Feb 16 '14 at 16:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    see user profile for Bob C for list of all duplicates (5). – gm70560 Feb 7 '14 at 22:08
  • 1
    Please edit the question to provide some detail. See comments on previous questions for what you need to provide. – BradHards Feb 15 '14 at 0:51
4

To try and understand your Question, I have reviewed the Creating a Python Add-In Combo Box help page to remind me that ...

A combo box contains an editable field and a drop-down list. The user can select a value from the drop-down list, which appears at the user's request. If you make the combo box editable, the combo box will include an editable field into which the user can type a value. The scale combo box in ArcMap is a good example of a combo box.

If you are coming from a VB.NET background, then you may be thinking that a Python Add-In Combo Box can bind to an MS Access database as easily as a solution like these from another forum.

I have not had a requirement to try and work out the steps to do this using a Python Add-In Combo Box and ArcPy but am confident that Accessing data using cursors from the Data Access module of ArcPy (arcpy.da) will be required.

The example on the Creating a Python Add-In Combo Box help page does not include an editable field but that code could be:

  1. Run through to learn how to update the combo box with the list of layer names
  2. Adapted to learn how to update the combo box with a list of field values instead by using arcpy.da.SearchCursor
  3. Adapted more to include an editable field and work with arcpy.da.UpdateCursor and arcpy.da.InsertCursor

If there is existing sample code available for including an editable field in a Python Add-In Combo Box and using it to update a Personal Geodatabase feature class then I am not aware of it.

  • Can someone delete this post!!! – Bob C Feb 10 '14 at 21:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.