Get fields name of table in fields collection

FuzMic

DataBase Tinker
Local time
Today, 18:48
Joined
Sep 13, 2006
Messages
744
Hi guys

Another quick shot - i want to loop through all the fields in a table and list out the names.

So i am thinking of the field collection with all the Dim & Set and want a sure quick job done.

I think we can also do it with an recordset.

Will appreciate a quick comparison. Thanks in advance.
 
One really easy way that displays the fieldnames in a Listbox is to use the FieldList setting of the listbox's RowSourceType. Put the name of the table (or query) in the RowSource.
 
Essentially anything that behaves like a recordset will have a fields collection. If you have a form bound to a table (as opposed to a query) then Me.Recordset.Fields will work from that form to show you the fields in the table - but only for that one table that is bound.
 
Thank you folks. I have just used the .fields associate with recordset.
 

Users who are viewing this thread

Back
Top Bottom