use form to select table field

shaomwang

Registered User.
Local time
Today, 18:07
Joined
Apr 22, 2000
Messages
14
How to make a form let user to select fields of the table?
 
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
 

Users who are viewing this thread

Back
Top Bottom