I have a fairly good house/setup, where I have "zoned" access !
We have a Doggy Door, which leads in, into the Utility room...tiled. Then, into the Kitchen...tiled.. Then into the Breakfast Room...tiled. Each of these areas can be closed off, and beyond that, the accesses to the Computer Room, Living Room and upstairs can be closed as well, where we have Carpet.
At First, both of mine were limited to the Tile areas during the night, and when I was away. I had the Potty Paper laid out directly in front of the Doggy Door, and both mine would bypass it to get outside to potty, when it was open, EXCEPT when it's cold or raining.
They don't like to be cold or wet !
When I got My Female Becca, My Male Sneakers was 2 years old. I put a box by the expanding door to the carpet areas, where Sneakers could jump onto it, then over, but, Becca was not big enough to do that. That permitted him to have access as he had "earned", but kept any deposits where they could be cleaned up, and appropriate "scolding" administered to the guilty party.
I'm not sure that it took Becca any longer to learn to be "neat" and go on the Paper IF she couldn't get outside than it did Sneakers, but, access was given to the whole house eventually, once their reliability was established.
Today, with Becca over a year old, I rarely close access to anything and both have access to the upstairs and all areas except the Computer Room. I haven't see any evidence of an inappropriate deposit anywhere except on the Paper for quite some time, and that only when the Door to the outside was closed. I think it's also very good, that the Paper is right in front of the Door, and if they can't get out, they are right there where it's an acceptable alternate area.
IMHO Yorkies are just naturally neat, and want to go outside to do their business. Beyond that, I also think that Yorkies are highly intuitive, and have stated in other Posts here, how I support/encourage for them to think for themselves.
I've herd of other Breeds being "SO" smart, and have the accolades to advertise that, but... There's a lot more to "smart", than just knowing a bunch of tricks, and I'm here to tell you, Yorkies take NO second place to any Breed.