1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub Commande3_Click()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
'Create the table with a memo field
Set db = CurrentDb()
Set tdf = db.CreateTableDef("Table1")
Set fld = tdf.CreateField("MyRichTextField", dbMemo)
tdf.Fields.Append fld
With tdf.Fields("MyRichTextField")
.Properties.Append .CreateProperty("TextFormat", dbByte, acTextFormatHTMLRichText)
End With
db.TableDefs.Append tdf
'Clean up
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
End Sub |
Partager