I use these lines to delete the records from a temporary table and reset ID automumbering to start from 1 again:
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [INFOs midlertidig]"
DoCmd.RunSQL "ALTER TABLE [INFOs midlertidig] ALTER COLUMN [Id] COUNTER(1,1);"
DoCmd.SetWarnings True
But the "Alter table" fails with "Runtime error 3211" = "Table can't be locked" because some 'other' user or process uses the table' - but no one else is on the DB - and I can't see what process could be running ! :banghead:
How can I cure that problem ?
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [INFOs midlertidig]"
DoCmd.RunSQL "ALTER TABLE [INFOs midlertidig] ALTER COLUMN [Id] COUNTER(1,1);"
DoCmd.SetWarnings True
But the "Alter table" fails with "Runtime error 3211" = "Table can't be locked" because some 'other' user or process uses the table' - but no one else is on the DB - and I can't see what process could be running ! :banghead:
How can I cure that problem ?