Heat oven to 350°.
Mix flour, salt, and pepper.
Place 1/2 of the potatoes in 2-qt greased casserole.
Sprinkle with half the seasoned flour and onion; add half the ham.
Repeat; then arrange third layer of potatoes on top.
Pour hot milk over all.
Dot with butter.
Cover and bake 30 min.
Uncover and bake 60 to 70 min longer, or until potatoes are tender.