Default Value in a ComboBox

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?
 
T

tina

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.
 

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