ComboBox populated with indexes of a table

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I want to build a public function that will populate the
value of a combobox with the indexes of a table. This will
limit the fields available to search. I can get a message
box to display the values but cannot get it any other way.
A sample code snippet would be most helpful.
 
fast code just to show the idea

dim idx as dao.index, tdf as dao.tabledef
dim strList as string

set tdf=dbs.tabledefs("mytable")
for each idx in tdf.indexes
strList =strList & ";" & idx.name
next

me.cbo.rowsource=mid(strList,2)

cbo - is combo box with row source type=value list

HTH
 
-----Original Message-----
fast code just to show the idea

dim idx as dao.index, tdf as dao.tabledef
dim strList as string

set tdf=dbs.tabledefs("mytable")
for each idx in tdf.indexes
strList =strList & ";" & idx.name
next

me.cbo.rowsource=mid(strList,2)

cbo - is combo box with row source type=value list

HTH

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com






.
Thanks, works like i wanted
 
Back
Top