473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Listing fields in a table

Thanks for the replies regarding adding fields on the fly. .. I'm now
managing that. I can't seem to do something that ought to be more simple,
that is to give the user a list of current fields in a table!
Nov 13 '05 #1
1 1297
On Wed, 26 Oct 2005 06:10:27 +0100, JohnM wrote:
Thanks for the replies regarding adding fields on the fly. .. I'm now
managing that. I can't seem to do something that ought to be more simple,
that is to give the user a list of current fields in a table!


You can either
1) Set the RowSource type of a combo box to Field List.
Set the RowSource to the name of the table.

or ....

2) Paste the following into a Module

Public Sub GetFieldNames()
Dim dbs As Database, tdf As TableDef, fld As Field
' Return reference to current database.
Set dbs = CurrentDb
For Each tdf In dbs.TableDefs
If Left(tdf.Name, 4) <> "MSYS" Then
Debug.Print tdf.Name
For Each fld In tdf.Fields
Debug.Print " " & fld.Name
Next fld
End If
Next tdf

Set dbs = Nothing
End Sub

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chris | last post by:
Hi, Not sure if this is the right forum, but hopefully someone can help me. I am creating something for our intranet and i want to list the files and folders of a directory, i found some code...
2
by: Colin | last post by:
I have a table, which is a list of courses with a CourseID key field and about a dozen fields describing the courses. I also have a table that lists all of the students taught by one teacher, which...
3
by: Bennett Haselton | last post by:
I want to display a hierarchical listing of items from a database table, where, say, each row in the table has an "ID" field and a "parent_id" field giving the ID of its parent (NULL if it's at the...
2
by: vbsourcer | last post by:
Hello all could anybody tell me how I would be able to list information from a database using Two Fields from the Database ? I have this code which will populate the listbox with exactly what I want...
7
by: vbsourcer | last post by:
Listing two fields -------------------------------------------------------------------------------- Hello all could anybody tell me how I would be able to list information from a database using...
0
by: vbsourcer | last post by:
Hello all could anybody tell me how I would be able to list information from a database using Two Fields from the Database ? I have this code which will populate the listbox with exactly what I want...
8
by: PW | last post by:
Hi, There is code in Alison Balter's excellant "Mastering Access 2003" to create a list of error codes and descriptions but it only generates error messages 3 through 94. Is there a website...
7
MitchR
by: MitchR | last post by:
I am trying to Script a listing of items from a table. These items would show in an email generated by the script. The email generation is good ... My question is how to script the listing of items...
8
by: Swizylstik | last post by:
I'm a newbie to ASP and databases. I have created a simple contact list database and an asp page that shows the contact listing. So far so good. Here's what I have:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.