Any time my dogs have had an accident, I immediately take them outside and let them know to go out here. I don't yell at them or anything. I just remind them that THIS is the correct place to go, not inside. Now the only time I've had issues is while we're sleeping and we don't hear them needing to go. In that case, it really was our fault. They can normally hold it 8-12 hours, but I make sure they get outside every 1-2 hours if I'm home, or 3-4 hours when my family is home and I'm not. Then, overnight they go 6-8 hours. I let them out right before I go to sleep, and let them out again as soon as I wake up. If they have sick bellies, then there's nothing I can really do to control that. I just have to remain calm, clean it up, and help them get over whatever the sickness is that's causing the diarrhea.
As for the yard. There's been times when I've been too busy to pick up the poo in our fenced in yard too. I noticed that the dogs would still do their business back there, but would not run around or play or explore or anything with poo piles everywhere. I finally caught a break from work and had time to pick it all up, and they were back to their old selves, running and chasing and roughhousing in the yard, happy as could be. So the fact that there's poo everywhere definitely causes the pups to not want to use it until it's all cleaned up. Now I make my "rounds" daily to pick up any and all poo piles. I bought this house with a large fenced in yard for a reason: for the dogs to run and play and have fun. I don't want my laziness or lack of time to cause them to be sad while out back.
Hope that helps!