|
如题所示,access链接表中的自动编号没有办法回到从1开始,找到代码,有个地方不知怎么修改才对啊
模块
Sub 自动编号(tbname As String, MyID As String)
Dim strsql As String
strsql = "ALTER TABLE " & tbname & " DROP COLUMN " & MyID & ""
CurrentDb.Execute strsql
strsql = "ALTER TABLE " & tbname & " ADD COLUMN " & MyID & " Counter"
CurrentDb.Execute strsql
End Sub
窗体按钮单击代码
Private Sub Command99_Click()
Me.form5查询子窗体1.Form.RecordSource = ""
Call 自动编号("form5", "Lable25")
Me.form5查询子窗体1.Form.RecordSource = "form5"
End Sub
关键是模块中的CurrentDb报出错
应该是要连接SQL的语言,无法使用,帮帮小子,谢谢了! |
|