0
votes

in VBA (MS-ACCESS), when I try to lock a combobox, an error occurs: 'Error 2166: control cannot be locked whilst there are unsaved changes'.

How I can save the changes?

PD. The ComboBox has RowSource but it's value isn't linked (DataSource is empty)

'Inhabilito el combo
oComboBox.Locked = True
oComboBox.BackColor = VBGRAY
1

1 Answers

1
votes

Add this before you try to lock the combobox to ensure there are no unsaved changes:

If oComboBox.Dirty Then oComboBox.Dirty = False