Investors & landlords

By filling out Form 4797 (when I answer the Yes-No question in TT if I disposed (Sold) of the property), TT assumes I sold it and generates a capital gain. 

 

And Form 8824 does not seem to nullify the capital gain generated in Form 4797...or does it?  I seem to be "missing" the link between the 4797 and the 8824