ComboBox populated with indexes of a table

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.
 
A

Alex Dybenko

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
 
B

bob

-----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
 

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