If the names are in a table of their own, just put the table name in the combo box's Row Source property, set the Row Source Type to Table/Query, and set the Column Count, Column Widths, and Bound Column properties.
If the names are in another table, where they may occur repeatedly, create a query on that table that selects the consult name. Set the Unique Values query property to Yes. Then use the query in the combo box's Row Source instead.
If the names aren't in a table at all, you can set the combo box's Row Source Type to Value List, and type the names in the Row Source property, separated by semicolons (";". Rick Sprague
Dim db As DataBase
Dim dbname As String
dim rs As Recordset
dbname = app.path & "\mydatabase.mdb"
Set db = Opendatabase(dbname,False,False)
Set rs = db.OpenRecordset(" Select name,* From MyTable ",dbOpenDynaset)
do while not rs.EOF
combo1.AddItem " rs!name & ""
rs.MoveNext
Loop
if it's a dynamic range you will need to populate it on open or at some time via a macro.......i can show you how to use a multi-column combobox with dynamic ranges if necessary......if u need help email me at:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.