|
▼小僧 さん:
DAOでなんとかできました。
※要参照設定 Microsoft DAO x.x Object Library
Sub DAOで処理()
Dim tdfs As DAO.TableDefs
Dim tdf As DAO.TableDef
Dim flds As DAO.Fields
Dim fld As DAO.Field
Dim TName As String
Dim FName As String
TName = "T_Test"
FName = "可否"
Set tdf = CurrentDb.CreateTableDef(TName)
With tdf
.Fields.Append .CreateField("備考", dbText, 50)
.Fields.Append .CreateField("配布週", dbText, 255)
.Fields.Append .CreateField("回収期限", dbText, 255)
.Fields.Append .CreateField(FName, dbBoolean)
End With
CurrentDb.TableDefs.Append tdf
Set tdfs = CurrentDb.TableDefs
Set tdf = tdfs(TName)
Set flds = tdf.Fields
Set fld = flds(FName)
fld.Properties.Append fld.CreateProperty _
("DisplayControl", dbInteger, acCheckBox, True)
Set fld = Nothing: Set flds = Nothing
Set tdf = Nothing: Set tdfs = Nothing
End Sub
|
|