新建模块——>贴上下面代码——>运行

Function ClearAllData()
     Dim rst As Object
     DoCmd.SetWarnings False
     Set rst = CreateObject("ADODB.Recordset")
     rst.Source = "Select [Name] FROM MSysObjects Where Type=1 AND Not [Name] Like 'MSys%'"
     rst.Open , CurrentProject.Connection
     Do Until rst.EOF
         DoCmd.RunSQL "Delete FROM [" & rst![Name] & "]"
         rst.MoveNext
     Loop
     rst.Close
     DoCmd.SetWarnings True
 End Function

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-08-04
  • 2021-08-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2021-11-30
  • 2021-09-23
相关资源
相似解决方案