|
复制并更改字段默认值再导入
Private Sub 新建表_Click()
On Error GoTo Err_新建表_Click
Dim dbs As DAO.Database
Dim tdf As TableDef
Set dbs = DBEngine.OpenDatabase("ccc_be.mdb")
dbs.Execute "SELECT * INTO 内容表3 FROM 内容表"
Set tdf = dbs.TableDefs!内容表3
tdf.Fields("乡镇").DefaultValue = "第二乡镇"
DoCmd.TransferDatabase acLink, "Microsoft Access", "ccc_be.mdb", acTable, "内容表3", "内容表3", False
Set tdf = Nothing
Set dbs = Nothing
Exit_新建表_Click:
Exit Sub
Err_新建表_Click:
MsgBox Err.Description
Resume Exit_新建表_Click
End Sub
顺便问一下,你是做什么工作的,用到乡镇? |
|