View Full Version : use form to select table field


shaomwang
01-14-2001, 04:35 AM
How to make a form let user to select fields of the table?

ntp
01-14-2001, 07:42 AM
Create a list/combo box in which you will put the list of fields.

if your table name is stored in a variable called strTblName, then

Dim fldObject as Field
Dim dbs as Database
Dim strList as String

Set dbs = CurrentDB
strList = ""
For each fldObject in dbs.tabledefs(strTblName).fields
strList = strList & fldObject.Name & ";"
next fldObject
me.cboFieldList.RowSource = strList
dbs.close
set dbs = nothing


ntp