does it have a hinged lid somewhere?
our hampsters used to have wire cages with holes in the roof about big enough to get your hand through. this was hinged at one end, and held close with a spring on the hinge.
quite safe we thought, since the roof is well out of the reach of the hampster.
however, what hammy used to do was climb up one side of the cage, and then walk across the roof. this was done by hanging on with her teeth and front paws, with the rest of her hanging straight down.
once on the roof she would work across to where the door was, and push at it. by pushing at the end farthest from the spring she was quite capable of opening it enough to climb out onto the top of the cage.
it was ages before we discovered this was how hammy was getting out.
sometimes while cleaning out her cage we would place her in a square bin with some food. this was smooth plastic with right angled corners. she was quite capable of climbing out of this, by getting into the corner and pushing off the two sides. we wouldnt have thought it was possible until we saw it
never underestimate a hampsters ability to get out and about
Doreen, as for toilet training, have you tried those small bonio dog biscuits? they are about the same length as an average hampster. ours used to love them. however whenever we gave them a new one, they used to prop it up in one corner of the cage and then pee all over it.
thought two: if hammy is prone to making a mess only when you get her out of her cage to handle her, then she is probably just very frightened. one of my hampsters was like that, he used to produce an amazing amount off poo when ever i got him out. however, with regular (daily) exposure, and me being very kind and gentle with hammy he got used to me, and the problem went away.