Only on CX/AA/QF/IB flights can you segment select which FF program you want credited.
ie Say, QF from SYD-HKG, and CX from HKG to LHR and AA from LHR to NYC. You can credit one segment at a time to each FF programme you want credited to. IB is a little tricky but it does work similarly.
ie QF flight on Asiamiles, CX flight to AA, and even AA flight to CP. This does NOT work for BA flights as BA's computer will accept that first number you input for all flights and cannot even be replaced at the airport.
Rather than have an airline do it for you - if you made your booking through your travel agent, he / she can input the correct info for you. Most airlines do not know how to input other airlines' FF programme into their system...with the exception of AA staff.