This can be done without a loop, though that option works also.
Define an added table with two fields: CDID--an auto-entered serial number. CDTitle--with Unique Values, validate always enabled.
Import the data first into this table, and enable the auto-entry operations option that pops up in the last dialog you see before the import. This import will load this new table with one copy of each CD Title.
Now link your existing table of CD tracks to it in a relationship by CD title.
CD TitlesTable::CDTitle = CDTracksTable::CDTitle
Define your CDCode field in CDTracksTable to use the auto-enter by calculation field option to use this expression:
"XR" & Right ( "00" & CD TitlesTable::CIDID ; 3 )
You can now import the same data into the CDTracksTable, again with auto-enter operations enabled, and the track records will all be assigned the IDcodes you've specified.