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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set combo box to display first row of table source on form entry

Status
Not open for further replies.

punky

Programmer
Mar 21, 2001
29
US
I need to be able to set listindex of combo box so first row
of its source is always showing when form initially opens.
What is the format of this access statement?
 

Add the following code to the On Load event of the form.

Me.Combo2 = Me.Combo2.ItemData(0) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
HI Throadbent(MIS),

Thanks for the code, but when I used it I got
"Method or Data Member Not Found". It is dieing on
the data member, even tho I used the name of the field
from the combo's source table. Any other method I could
try? I am using Access 97.
 
The simplest solution is under properties, set the Default Value to be

[cboSample].[ItemData](0)

'cboSample' being the combo box name and (0) being the first record.

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top