Oh I have a question! I have a 2 year old cairn terrier, Flapjack. She's the very best animal in all possible ways, except for one thing - midnight pees. When I permit her to sleep in bed with me she doesn't have to go out until morning, but when she sleeps in another part of the house she never asks to go out and pees on the floor. She knows she's made a mistake and acts bashful. What to do?
This problem sounds like a two-fold issue.
First, it sounds like Flapjack may not have been fully house trained. What is she lacking? A way to let you know she needs to go out! How does she signal she needs to go out during the day? If your answer is that she circles at the door, walks to you, or you just take her out on a schedule, that's fine, but it's not going to be great a night when you're sleeping. Try teaching her to ring a bell on the door, something you can hear. The hope would then be that it's easier for her to let you know she needs to go out, and you'll be better able to get up and help her.
Second, it sounds like she simply sleeps better when she's with you. This may be because she feels safer with you or she's warmer with you, or just that you have a more comfortable bed, but whatever the reason, she sleeps better when she's with you. Have you ever had a slightly fitful night's rest? Have you noticed that generally on those nights you need to use the bathroom at some point? The same is probably happening for Flapjack. So, we need to help her rest better. Try giving her a little more exercise closer to bed time, and make sure she feels safe and secure (and comfortable) in her bed. A crate may be a good option as well, as it tends to help with the security aspect, and it keeps her from wandering off and peeing somewhere.
While working on those two things may solve the issue, I'd like to mention one other thing. Pay attention to how much water she's drinking and limit her water at night. You may want to try pulling water up an hour or so before bed time, or just put ice in a bowl so she can't guzzle the water all at once. Just keep in mind that what goes in must come out, and if she's drinking a lot of water then she's also going to have to pee.
One last, final, important note. When you wake up and find a puddle of pee on your floor, it's important to not punish Flapjack. If you don't catch her in the act of peeing, then you've lost your opportunity. Anything after that is just punishment for punishment's sake, and that's not fair to her.
Good luck with Flapjack, and please keep me posted!