I have found an interesting occurrence where Access doesn't seem to be able to read a null value in a combo box.
The operation is: one makes a selection in a combo box and then clicks a button to open a form and find a record based on the value in the combo box.
However if someone opens the combo box list and clicks away from the combo box, say on the form background the list closes and displays an empty field. Then if the button is clicked everything goes wrong because the form opens but there is no record to display.
I have tried to trap this ‘bug’ a couple of ways:
>> Code like If IsNull (combo.value) then ... behind several events like the combo box’s After Update Event or Lost Focus Event, even the On Click Event of the form’s detail section.
>> Using <>"" in the combo boxes validation rule doesn’t work either.
The any of the above traps work if one: opens the combo box, selects a value and then blocks and deletes the value, but to repeat myself definitely not if one clicks away before making a selection.
Has anyone come across this before? Any ideas as always are gratefully received.
The operation is: one makes a selection in a combo box and then clicks a button to open a form and find a record based on the value in the combo box.
However if someone opens the combo box list and clicks away from the combo box, say on the form background the list closes and displays an empty field. Then if the button is clicked everything goes wrong because the form opens but there is no record to display.
I have tried to trap this ‘bug’ a couple of ways:
>> Code like If IsNull (combo.value) then ... behind several events like the combo box’s After Update Event or Lost Focus Event, even the On Click Event of the form’s detail section.
>> Using <>"" in the combo boxes validation rule doesn’t work either.
The any of the above traps work if one: opens the combo box, selects a value and then blocks and deletes the value, but to repeat myself definitely not if one clicks away before making a selection.
Has anyone come across this before? Any ideas as always are gratefully received.