Might be 'cleaner' to concatenate variables into SQL statement so there are not multiple sets of RunSQL commands. It is not necessary to specify fields in DELETE action. I prefer CurrentDb.Execute. This could be a Sub.
Code:
Sub Cleanup()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = CurrentDb
For Each tdf In db.TableDefs
If Not (tdf.Name Like "MSys*" Or tdf.Name Like "~*") Then
db.Execute "INSERT INTO Master" & Mid(tdf.Name,4) & " SELECT * FROM " & tdf.Name
db.Execute "DELETE FROM " & tdf.Name
End If
Next
Set tdf = Nothing
Set db = Nothing
End Sub