We help IT Professionals succeed at work.

Reset combo box to first item

I don't know if this a SharePoint or a MS Access question. I have a MS Access 2010 web database on SharePoint. I'm using a combo box to filter a form. After update  triggers a macro using the SetFilter action. How can I reset the combo box to the first item. Your help is greatly appreciated.
Comment
Watch Question

Top Expert 2014

Commented:
Have you tried setting the ListIndex property of the combobox to zero?
Hamed NasrRetired IT Professional

Commented:
In Form_Open event procedure::

Private Sub Form_Open(Cancel As Integer)
   Combo1.Value = Combo1.ItemData(0)
End Sub

Open in new window

Author

Commented:
I've been unable to figure out how to do this. This is a web database. The bound column property is not available for my combo box. It is only available client side. vba is also only available client side. I think I need to use a macro to set the property but the list index property cannot be set with a macro.
Distinguished Expert 2017

Commented:
The web app has significantly less functionality than traditional client/server apps.  In some cases, you can get around the deficiencies by creating a hybrid app.  With a hybrid app, all your data is in Azure and available from anywhere but some or all of the processing part of the app stays as an .accdb and is distributed the way your LAN apps were.  The difference is that the BE is in the cloud.  Be aware, that if you are not hosting Azure yourself, you may have speed issues that a service bureau will not be interested in solving.
I found a solution. I used the Macro SetFilter action to filter the records on my form using the value of a combo box. I added a command button to clear the filter using the on-click event. I used the SetFilter action and for the Where expression I entered "". I then used the SetProperty action to set the value of the combo box to __(blank, empty field).

The SetProperty must happen or occur before the SetFilter action or it will not work.
Distinguished Expert 2017

Commented:
Thanks for reporting back with your solution, especially the warning:)