We had a rescued Basset with barking habits. A beer can with a couple of hex nuts in it. Starts inappropriate barking, told her "NO, Quiet" another bark, threw the can very near her. After a few days either "NO BARK" or rattling the can, then just "No Bark", then picking up the can and then just "No Bark" did the trick.
Our curent rescued bassets ignored the thrown can, so the next step up would be to throw it to hit them. We decided that that wasn't acceptable, and clearly for a decrepit Yorky overkill in too many ways. So we used the squirt bottle routine. It worked and now all we have to do is ask them if they want "The Bottle" and they shut up. Or if we pick-up anything that appears to be a spray bottle. They need a little refreser training though, I think the wife and sons have been feeding too many snacks to get desired reactions. Now they don't obey other things until they get the snack.
As noted RESCUED dogs can be pretty messed up, you probably don't know what abuse they have suffered and what will trigger a negative reaction, so training can be a challenge. Our Sam was under-fed and apparently trained to stay off furniture by physical violence. She was mentally unable to jump when we got her, we had to train her to jump. Food worked real well, but she was liable to aggressively and dangerously go after any kind of food, so we had to be real judicious. Sam would baark whever our othe basset would get on the couch or a bed, she will even bark at people who get up on things. Clearly she is telling the other dog or the people to look out and get down. It's taken about 6 years but I can hold a treat in my hand and she will only nuzzle to get it, when we first got her she would bite her way to food, using the bite as a tool and warning. Now she only gets mean when you try to take a piece of meat away from her. She gets frustrated though, she knows if she bites at Daddy the meat gets away when she opens her mouth. Lilly leaps up and knocks or grabs things down and then Sam takes it away from her. Be glad you have Yorkies, you oughta see what happens when one idiot basset gets a bag of flour and then tries to run away from the other basset chasing her to get it away from her.
Yes, bassets eat flour, bananas, whole cantaloupes, apples, corn on the cob, corn cob, tomatoes and berries off the vine, whole cans of altoids from purses (both Moms and guests), gum and other candies from my 19 year olds buddies' back packs. They were sitting around the outdoor fireplace the other night and the girls rifled their bags for goodies while they weren't paying attention.