Wednesday, June 17, 2009

Refreshing combo boxes in Microsoft Access VBA

For those of you using VBA in Microsoft access and need to refresh a combo box, I've figured out how to do it.

Add a button or create an event in the combo box properties. For the event, just set the row source for the combo box (Even though it will just be the same table, it will still use the updated information)

Combo87.RowSource = "SELECT [tablename].field1, [tablename].field2, [tablename].Field3, [tablename].Field4 FROM [tablename] ORDER BY [field];"

You can get the select statement from zooming in on the current setting for the row source.

And have a good day

No comments: