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

Populating list boxes with the names of the fields of the tables 1

Status
Not open for further replies.

jbranero

Technical User
Jun 3, 2005
17
US
Hi there, I am trying to populating list boxes with the names of the fields of the tables and I would like to make a SELECT in the Row Source property.
Does anybody have an idea about or another way to do it.
Thanks
j
 
What application?

If it's Access, there are seven fora dedicated to Access, might try one of those for the next Access question? Getting field names in Access can't be done through SQL, as far as I know, but set the rowsourcetype of the list to field list, and the rowsource to the name of the table you wish to show the fields from...

Roy-Vidar
 

If you're using ADO or DAO, then the Field.Name property can be used like this...
Code:
...
set rst open .....

for each fld in rst.fields
  msgbox = fld.name
next


Skip,

[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue]
 
oops....

no [equal] sign in a msgbox, is there.



Skip,

[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue]
 
Great! it works perfectly.
Thanks a lot Mr. Roy.
 
Also thanks to Skip! I think that in this case the suggestion from RoyVidal is easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top