combo and show first value - 2007

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
 
G

Guest

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")
 
J

JC

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.
 

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