This is caused by a record number that is a duplicate or has been deleted, but not removed from the record.
Run File Maintenance in Medisoft and select all files under Rebuild Indexes, and then Pack the Data. If this does not resolve the problem, professional data repair may be necessary.