How to prevent user from blanking out a combobox value?

D

Dean Slindee

I have a combobox on a form that is displayed in grid mode. I want to
prevent the user from blanking out the combobox value. The combobox value
list is populated from a table of valid values; it does not have a blank row
as a valid value. On a non-grid form, I would set the "limit to list"
property to Yes. I tried that on the grid view of the form, and Access let
me move off the combobox after deleting the text. Looks like "limit to
list" does not work in grid view?

I also tried using the "NotInList" event, but that only fires when there is
an invalid text value in the combobox, not when the combobox text value is
empty.

Any other suggestions?
Thanks in advance
Dean S
 
T

tina

have you tried setting a validation rule on the combo box control, as

Is Not Null

if that doesn't do it, you could try adding code to the control's
AfterUpdate (or perhaps Exit) event to insert a "default" value, as

If IsNull(Me!ComboboxName) Then
Me!ComboboxName = <the default value goes here>
End If

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top