Yes, use CEdit::ModifyStyle()
to either set or clear the ES_NUMBER style.
So, to make it accept numbers only:
CEdit *pEdit = // get your control here ...
pEdit->ModifyStyle(0, ES_NUMBER);
And to revert to accepting all characters:
pEdit->ModifyStyle(ES_NUMBER, 0);