Link to home
Start Free TrialLog in
Avatar of SimonKravis
SimonKravis

asked on

VBA Combo Box will not release focus

I am trying to set a combo box on an Access form to a value not present in the drop down list, which is empty. If I enter data, and try to set focus elsewhere on the form I am unable to do so - the empty drop-down box appears. If I delete all the entered data then I can move the focus away.  What do I have to do in order to set the value in the combo box?
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

If the dropdown is empty, you'd have to add the value to your combo's recordsource in order for it to display later. for example, if you have a combo, and you add the value "Bob" to it, Access will store that value in the combo's underlying field, but it will NOT store that value in the combo's underlying recordsource (i.e. whatever supplies the combo's RowSource). So if you navigate over to a different record, then back to the first record, then your combo won't show the stored value, since it won't be in combo's rowsource.
Avatar of SimonKravis
SimonKravis

ASKER

Does a VBA combo box allow entry of values not in the dropdown list? A VB one does, but VBA controls are often subtly different. If it doesn't then what I want to do isn't possible.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial