Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box - display first result 2

Status
Not open for further replies.

lachesis

Technical User
Sep 25, 2002
138
NZ
Its probably staring me in the face but I can't see the wood for the trees at the moment. [ponder]

Ive got a combo box on a form that creates a list from a table when the form is opened. I want the combo box to display the first record it retrieves when the form opens, instead of a blank.

I know this is easy but i dont use Access on a regular basis. thnx

L. [deejay]

 
lachesis

You should be able to enter
1
in the 'Default Value'

Tom
 
This should do the trick:

ComboName = ComboName.Column(1, 1)

Good luck
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Did I mention the combo box is unbound.

wizcow - your suggestion just returns '1', not the first record in the list.

dan - what control field should I add this function to??

L. [deejay]
 
"I want the combo box to display the first record it retrieves when the form opens"

Use the Load event of the form:

Sub Form_Load()
ComboName = ComboName.Column(1, 1)
End Sub

Change ComboName to the exact name of the combo box on your form and...voila...

Good luck

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top