STOP RIGHT NOW. You can't just change the PK of the table without knowing if there are relationships defined or how queries are joining to this table!!!!!!!!!!! And I can't believe you were told it was OK to just swap the PK without any investigation at all.
Before we get to how to resolve the issue, you need to understand that autonumbers are intended to provide unique identifiers when no other candidate key exists. If you have a candidate key but it is multiple columns or text, you will almost always use an Autonumber (surrogate) as the PK and make a unique index on the candidate Key that includes one or more fields to define uniqueness. Just because you use an Autonumber as the PK doesn't mean that that is what people will search on. They will search on either a text field like customer name or some more userfriendly code that you assign. Your Code No is a user generated code. without knowing anything about how it is generated, it seems to just be a sequential number so it should have been possible to use the Autonumber. But we won't go there now. It isn't relevant. Also , just to be clear, when you have relationships between tables they will always be on the PK of one table to a long integer in another table.. There will be occasions when you want to join tables on data field to data field but those cases will be when you are looking for bad data or working with imported data that doesn't contain your PK. A join in a query is NOT a relationship even though they look the same in the diagram. A relationship defined in the BE relationship window has the power to enforce Referential Integrity and keep certain kinds of bad data from ever being added to your tables. A join just allows you to connect two tables or queries and doesn't even have to make sense. you can create the join and the query will return some results but probably not what you expect. For example, SSN is a nine digit numeric code so is phone number. So, since the data types are the same (or compatable), you can create a query that joins SSN from the employee table to MainPhone on the company table. Does that make any sense? No, but you can do it. However, you would not be able to make a relationship because it is extremely unlikely that the set of data in the SSN column will match the set of data in the phone column.
To determine what if anything needs to be done:
1. Open the relationships window in the BE and look at the relationships. If there are none defined, that's your clue that the database was designed by someone who didn't understand relational databases and you should come back here after your issue is resolved and add them. If there are relationships, you should be able to determine how the tables are joined. If the join lines connect to EqupID, then the relationships are correct. If they join to the Code no, they are incorrect and RI cannot be enforced.
2. Open the FE and find the queries that reference this table. Access actually has a tool that helps with this. Look at the joins. What fields are connected? Are the joins linking to EquipID or to Code No? If they are joining to EquipID, the relationship has been defined correctly and should not be changed. If the joins ae to Code No, then the relationship is incorrect and you have work to do to resolve the issue.
Once you have determined what the developer thought of as the PK, you will know how to proceed. regardless BACK UP THE DATABASE before making ANY design changes. Make sure that no one is using the App at all. An easy way to ensure this is to go to the folder that holds the BE. as long as there is no .laccdb file, you can rename the BE to SAVEmydatabasename.accdb. That will ensure that if anyone opens the app before you are finished, they will get an error so send all the users an email warning.
Also, Go to the backstage Options and turn off Name Autocorrect. This is really important. If you don't turn it off, you will end up with a real mess on your hands. If you want it on and you actually understand how it works, you can turn it back on when you're done. Otherwise, it is best to leave this less than helpful feature off for safety.
1. If the joins are on code No,
--- set Code No to unique. If you get no errors, it is unique. If you get errors, it is not unique and you have to resolve the duplicates before you can continue because the PK MUST be unique. PERIOD.
--- Once Code No is unique, you can make it the PK and rename the autonumber field. When we're done, you can delete the field but for now, we want to make sure to break anything that uses it. If the Autonumber is not going to be the PK of the table, it shouldn't be there at all.
2. If the joins are all on EquipID, then there is no change that needs to be made. So, return to your backup and restore it.