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

Displaying the fields in a table

Status
Not open for further replies.

M8KWR

Programmer
Aug 18, 2004
864
GB
I know how to display a list of tables, queries, forms, reports etc.

Is there a way of displaying the list of fields within the tables.

many thanks
 
Is this a table/relationship question?

On a form, you could create a listbox, set it's rowsource to the table you wish to display the fields for, then select "Field List" as rowsource type.

Else I think you'd need to programatically retrieve the field names, for something like this quick and dirty approach:

[tt]dim strFields as string
dim lngCount as long
dim rs as dao.recordset
set rs=currentdb.openrecordset("mytable")
for lngCount = 0 to rs.fields.count-1
strFields=rs.fields(lngCount).name & ", "
next lngCount
msgbox mid$(strFields,1,len(strFields)-2)[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top