以下是引用kevindeng在2006-8-17 8:41:00的发言:
那如果表的属性未设置,那么就不能用代码修改它了?
no
Dim fld As DAO.Field
Dim cp As DAO.Property
On Error GoTo gg
MsgBox CurrentDb.TableDefs("ff").Fields("食品名称").Properties("Caption")
On Error GoTo gg1
MsgBox CurrentDb.TableDefs("ff").Properties("Description")
On Error GoTo rr
MsgBox CurrentDb.TableDefs("ff").Fields("食品名称").Properties("Description")
Exit Sub
gg:
set cp = CurrentDb.TableDefs("ff").Fields("食品名称").CreateProperty("Caption", 12, "uuu")
CurrentDb.TableDefs("ff").Fields("食品名称").Properties.Append cp
Resume Next
gg1:
Set cp = CurrentDb.TableDefs("ff").CreateProperty("Description", 12, "uuu")
CurrentDb.TableDefs("ff").Properties.Append cp
Resume Next
rr:
Set cp = CurrentDb.TableDefs("ff").Fields("食品名称").CreateProperty("Description", dbText, "uuu1")
CurrentDb.TableDefs("ff").Fields("食品名称").Properties.Append cp
Resume Next
[此贴子已经被作者于2006-8-17 12:40:02编辑过]
|