You want to have a fine-grained control over user text entry.
Use the masked ActiveX edit control, which can restrict and format data according to an input mask.
The masked edit control looks like the text box control, but it includes enhancements for masked input and formatted output. If you don’t use an input mask, the masked edit control behaves like a standard text box.
To define an input mask, you set the Mask property with a string. The mask can include two types of characters: placeholders, which map to user supplied characters, and literal characters, which are entered automatically as the user types. The literal characters serve as visual cues that indicate the type of input that is being entered ...