If you put your code in a Function, you'd still need one line of code, in the KeyPress event of each Control, to call it, and since your current code could be reduced to one line, what would be the point?
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0
End Sub
I'd be more concerned with the fact that you have a RecordSet, and probably its underlying Table, with 200 Fields! Most experienced developers will tell you that a Table with more than 25-35 Fields is almost assuredly non-normalized.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007