Default Value in a ComboBox

  • Thread starter Thread starter Randy Harris
  • Start date Start date
R

Randy Harris

I set a default value for a combobox in design view, but it doesn't seem to
do anything. The form is bound to a query. The combo box is Null for new
records. What am I missing?
 
nothing, i think - it wouldn't work for me either. you
might try this instead:

Private Sub Form_Current()

If IsNull(Me!Combo0) Then
Me!Combo0 = DefaultValue
'don't forget to enclose the default value in
'quotes if it's text!
End If

End Sub

whenever a record becomes current, the field bound to the
combobox will get the default value unless there is
already a value in the field. don't use this unless you
think thru any problems this might cause with existing
records.
 
Back
Top