combo and show first value - 2007

  • Thread starter Thread starter JC
  • Start date Start date
J

JC

Hi,

I have a combobox that pulls its options from a table.

When the form is opened, the combo is blank until the user chooses one
of the options. The options change regularly depending on the current
records in the table.

I'd like the combobox to show the first option in its list instead of
being blank. Is that possible?

Thanks

Jeff C
 
You can use the form OnLoad event to set the first value in the combo

You can set it hard coded
Me.ComboName = 1

Or, I prefer setting it so the value will be brought from the table that the
combo use, with the right sort, so you'll always get the first record

e.g:
Me.ComboName = DMin("FieldNameInTable","TableName")
 
Thanks,

That did the trick. I used a requery to filter the subforms to that
record when the form is opened and it works great.

Your help is greatly appreciated.
 
Back
Top