This error may occur if the code table entry is currently in use in any part of your database. Most commonly these exist in the following areas: 
  • Constituent Record (including inactive and deceased constituents)
  • Query
  • Export definition
  • Uncommitted batches 
Ensure that the code table entry is not being used in these areas. You can also inactivate the code table entry so that it is no longer available for use.