Tables |
1.7 Eliminare tutti i records di una tabella. |
Federico Luciani |
Public Function SvuotaTab(nomeTab As String) DoCmd.SetWarnings False DoCmd.RunSQL "DELETE * FROM " & nomeTab & ";" DoCmd.SetWarnings True End Function 'OPPURE Function SvuotaTabella(strTab As String) Dim dbs As Database Dim rst As Recordset Set dbs = CurrentDb() Set rst = dbs.OpenRecordset(strTab) With rst If rst.RecordCount > 0 Then .MoveFirst Do .Delete .MoveNext Loop Until .EOF End If .Close End With Set dbs = Nothing End Function |